Browse Source

bug560,登录失效调试15

zhouna 3 years ago
parent
commit
cd571dc38e
2 changed files with 7 additions and 4 deletions
  1. 4 3
      src/js/roleManager.js
  2. 3 1
      src/js/utils.js

+ 4 - 3
src/js/roleManager.js

@@ -59,17 +59,18 @@ $(function(){
         })
     }
     function saveRoleMenu(params){
+	  const doc = parent?parent.document:document;
         post(api.saveRoleMenu,params).then(res =>{
             let data = res.data;
-            $(".loading").remove()
+            $(doc).find(".loading").remove()
             if(data.code == '0'){
-                $(".divModal").remove()
+                $(doc).find(".divModal").remove()
                 $.alerModal({type:"tip",message:"保存成功",win:true});
             }else{
 
             }
         }).catch((e) =>{
-            $(".loading").remove()
+            $(doc).find(".loading").remove()
         })
     }
 

+ 3 - 1
src/js/utils.js

@@ -186,8 +186,10 @@ const post = function (url, data, opts) {
         }
       },
       success: function (resq) {
+        const doc = parent?parent.document:document;
+        //console.log($(doc).find(".alertModal:visible"))
 		//失效后不点知道了直接刷新处理:跳回登录页
-		if(localStorage.getItem('toLogin')==='1'){
+		if(localStorage.getItem('toLogin')==='1'&&$(doc).find(".alertModal:visible").length===0){
 		  (parent||window).location.href='login.html';
 		}
         let res=resq;