소스 검색

fix: 免登录

ZhaoJun 1 년 전
부모
커밋
ec7f4d367f
3개의 변경된 파일8개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 1
      pages/approved/detail.vue
  2. 3 1
      pages/audit/OA/detail.vue
  3. 2 1
      pages/audit/detail.vue

+ 3 - 1
pages/approved/detail.vue

@@ -85,7 +85,9 @@ export default {
       return;
     }
     if (!uni.getStorageSync("token")) {
-      uni.setStorageSync("token", query["JWT-TOKEN"]);
+      if (query["JWT-TOKEN"]) {
+        uni.setStorageSync("token", query["JWT-TOKEN"]);
+      }
     }
     this.query = query;
     this.checkDeviceType();

+ 3 - 1
pages/audit/OA/detail.vue

@@ -108,7 +108,9 @@ export default {
   },
   onLoad(query) {
     if (!uni.getStorageSync("token")) {
-      uni.setStorageSync("token", query["JWT-TOKEN"]);
+      if (query["JWT-TOKEN"]) {
+        uni.setStorageSync("token", query["JWT-TOKEN"]);
+      }
     }
     this.id = query.id;
     this.query = query;

+ 2 - 1
pages/audit/detail.vue

@@ -114,7 +114,8 @@ export default {
     this.templateNodeId = options.templateNodeId;
     this.projectId = Number(options.projectId);
     this.id = options.excel_id;
-    if (!uni.getStorageSync("token")) {
+    // 如果链接带着token, 则强制替换最新的token
+    if (options["JWT-TOKEN"]) {
       uni.setStorageSync("token", options["JWT-TOKEN"]);
     }
     this.options = options;