Browse Source

Merge branch 'NPC-lhd'

natasha 2 years ago
parent
commit
9f2576913c
1 changed files with 19 additions and 17 deletions
  1. 19 17
      src/App.vue

+ 19 - 17
src/App.vue

@@ -52,24 +52,26 @@ export default {
           this.userAgentTipShow = false
       },
       // 是否超时
-    isTimeOut(){
+      isTimeOut(){
         clearInterval(this.timeOut)
-        this.timeOut = setInterval(()=>{
-            let lastClickTime = sessionStorage.getItem('lastClickTime')*1
-            let nowTime = new Date().getTime()
-            let dataConfig = JSON.parse(getConfig());
-            if(nowTime - lastClickTime > 1000 * dataConfig.user_connection_timeout_duration){
-                clearInterval(this.timeOut)
-                removeSession("SysList");
-                removeToken();
-                Cookies.remove("JSESSIONID");
-                this.userShow = false;
-                this.userMessage = null;
-                sessionStorage.removeItem("useragent_root_close");
-                window.location.href = dataConfig.sys_home_url
-            }
-        })
-    }
+        let dataConfig = JSON.parse(getConfig());
+        if(dataConfig.user_connection_timeout_duration){
+            this.timeOut = setInterval(()=>{
+                let lastClickTime = sessionStorage.getItem('lastClickTime')*1
+                let nowTime = new Date().getTime()
+                if(nowTime - lastClickTime > 1000 * dataConfig.user_connection_timeout_duration){
+                    clearInterval(this.timeOut)
+                    removeSession("SysList");
+                    removeToken();
+                    Cookies.remove("JSESSIONID");
+                    this.userShow = false;
+                    this.userMessage = null;
+                    sessionStorage.removeItem("useragent_root_close");
+                    window.location.href = dataConfig.sys_home_url
+                }
+            })
+        }
+      }
   },
   mounted(){
     sessionStorage.setItem('lastClickTime',new Date().getTime())