Browse Source

登录失效调试13

zhouna 3 years ago
parent
commit
c83f2b94fa
1 changed files with 5 additions and 4 deletions
  1. 5 4
      src/js/utils.js

+ 5 - 4
src/js/utils.js

@@ -186,6 +186,11 @@ const post = function (url, data, opts) {
         }
       },
       success: function (resq) {
+		//失效后不点知道了直接刷新处理:跳回登录页
+
+		if(localStorage.getItem('toLogin')==='1'&&$(".alertModal:visible", parent.document||document).length===0&&$(".alertModal:visible", document||parent.document).length===0){
+		  (parent||window).location.href='login.html';
+		}
         let res=resq;
         if(typeof resq ==='string'){
           res = JSON.parse(resq);
@@ -247,10 +252,6 @@ function unloginPop(msg){
 	  window.parent.postMessage(JSON.stringify(dialogmessage), '*')
     }else{
 	  console.log('父窗口')
-	  //失效后不点知道了直接刷新处理:跳回登录页
-      if(localStorage.getItem('toLogin')==='1'){
-		(parent||window).location.href='login.html';
-      }
 	  $.alerModal({
 		gobackBtn: true,
 		title: "提示",