Parcourir la source

登录异常处理

1178232204@qq.com il y a 3 ans
Parent
commit
159f557830
1 fichiers modifiés avec 9 ajouts et 9 suppressions
  1. 9 9
      src/js/utils.js

+ 9 - 9
src/js/utils.js

@@ -264,6 +264,15 @@ const post = function (url, data, opts) {
             data: jsonres.msg
           }
           window.parent.postMessage(JSON.stringify(dialogmessage), '*')
+        } else if (error.status === '10020013') {
+          $.alerModal({
+            "message": '登录异常',
+            type: "tip",
+            time: '1000',
+            isFather: true,
+            fatherWrapper: $("#mainBox", parent.document)
+          });
+          window.location.href = 'login.html'
         }
         resolve({
           data: res
@@ -341,15 +350,6 @@ const post = function (url, data, opts) {
             });
 
             // wd.location.href = '../error.html?code=' + error.status;
-          } else if (error.status === 10020013) {
-            $.alerModal({
-              "message": '登录异常',
-              type: "tip",
-              time: '1000',
-              isFather: true,
-              fatherWrapper: $("#mainBox", parent.document)
-            });
-            wd.location.href = "../login.html";
           }
         }
         reject(error);