Browse Source

登录失效调试9

zhouna 3 năm trước cách đây
mục cha
commit
594016699b
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      src/js/utils.js

+ 4 - 0
src/js/utils.js

@@ -141,6 +141,10 @@ const getUrlArgObjectNew = function (name, srcUrl) {
 window.abortAjax = '';
 
 const post = function (url, data, opts) {
+  if(localStorage.getItem('toLogin')==='1'){
+    //如果前面已经被标记为登录失效,接下来的请求都不发送
+    return;
+  }
   let isPlacefile = getCookie('isPlacefile') || 1;
   const token = localStorage.getItem('accessToken');
   if (!token && window.location.href.indexOf('login') == -1) {