Browse Source

登录失效调试15

zhouna 3 years ago
parent
commit
9d41ce1237
3 changed files with 5 additions and 4 deletions
  1. 1 1
      src/js/index.js
  2. 3 1
      src/js/qcScore.js
  3. 1 2
      src/js/utils.js

+ 1 - 1
src/js/index.js

@@ -32,7 +32,7 @@ const otherLogo = getUrlArgObject("adLg");
 const is3His = getUrlArgObject('is3His')
 //token判断没有跳登录
 const token = localStorage.getItem('accessToken');
-if (!token) {
+if (!token||localStorage.getItem('toLogin')==='1') {
   window.location.href = '../login.html';
 }
 const modalDom = `

+ 3 - 1
src/js/qcScore.js

@@ -6,7 +6,9 @@ const {post,getUrlArgObject,setBoxHeight,getCookie,getLocal,initScroll} = requir
 const {api,ywCheckApi} = require('./api.js');
 let checkOk = require('./../images/checkOk.png')
 const adLogo = require("../images/adlogo.png")
-
+if (localStorage.getItem('toLogin')==='1') {
+  window.location.href = '../login.html';
+}
 $(function(){
   const hideLogo = getUrlArgObject("hideLg");
   if(hideLogo){

+ 1 - 2
src/js/utils.js

@@ -187,8 +187,7 @@ 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){
+		if(localStorage.getItem('toLogin')==='1'){
 		  (parent||window).location.href='login.html';
 		}
         let res=resq;