瀏覽代碼

超时时间

natasha 2 年之前
父節點
當前提交
8865f78df4
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      src/App.vue

+ 4 - 2
src/App.vue

@@ -22,6 +22,7 @@ import { removeSession } from "@/utils/role";
 import { removeToken } from "@/utils/auth";
 import Cookies from "js-cookie";
 import data from './common/data';
+import { getConfig } from "@/utils/auth";
 export default {
   name: "App",
   data() {
@@ -81,7 +82,8 @@ export default {
         this.timeOut = setInterval(()=>{
             let lastClickTime = sessionStorage.getItem('lastClickTime')*1
             let nowTime = new Date().getTime()
-            if(nowTime - lastClickTime > 1000 * 5){
+            let dataConfig = JSON.parse(getConfig());
+            if(nowTime - lastClickTime > 1000 * dataConfig.user_connection_timeout_duration){
                 clearInterval(this.timeOut)
                 removeSession("SysList");
                 removeToken();
@@ -89,7 +91,7 @@ export default {
                 this.userShow = false;
                 this.userMessage = null;
                 sessionStorage.removeItem("useragent_root_close");
-                window.location.href = 'https://gcls.helxsoft.cn/'
+                window.location.href = dataConfig.sys_home_url
             }
         })
     }