|
@@ -18,12 +18,17 @@
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
|
|
+import { removeSession } from "@/utils/role";
|
|
|
|
+import { removeToken } from "@/utils/auth";
|
|
|
|
+import Cookies from "js-cookie";
|
|
|
|
+import data from './common/data';
|
|
export default {
|
|
export default {
|
|
name: "App",
|
|
name: "App",
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
dir: "ltr",
|
|
dir: "ltr",
|
|
userAgentTipShow: false,
|
|
userAgentTipShow: false,
|
|
|
|
+ timeOut: null
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -40,6 +45,21 @@ export default {
|
|
} else {
|
|
} else {
|
|
this.handleUserAgentRoot();
|
|
this.handleUserAgentRoot();
|
|
}
|
|
}
|
|
|
|
+ window.addEventListener(
|
|
|
|
+ 'click',()=>{
|
|
|
|
+ sessionStorage.setItem('lastClickTime',new Date().getTime())
|
|
|
|
+ }
|
|
|
|
+ )
|
|
|
|
+ window.addEventListener(
|
|
|
|
+ 'mousewheel',()=>{
|
|
|
|
+ sessionStorage.setItem('lastClickTime',new Date().getTime())
|
|
|
|
+ }
|
|
|
|
+ )
|
|
|
|
+ window.addEventListener(
|
|
|
|
+ 'mousemove',()=>{
|
|
|
|
+ sessionStorage.setItem('lastClickTime',new Date().getTime())
|
|
|
|
+ }
|
|
|
|
+ )
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
// 判断是否为chrome浏览器
|
|
// 判断是否为chrome浏览器
|
|
@@ -55,6 +75,28 @@ export default {
|
|
sessionStorage.setItem("useragent_root_close", true);
|
|
sessionStorage.setItem("useragent_root_close", true);
|
|
this.userAgentTipShow = false;
|
|
this.userAgentTipShow = false;
|
|
},
|
|
},
|
|
|
|
+ // 是否超时
|
|
|
|
+ isTimeOut(){
|
|
|
|
+ clearInterval(this.timeOut)
|
|
|
|
+ this.timeOut = setInterval(()=>{
|
|
|
|
+ let lastClickTime = sessionStorage.getItem('lastClickTime')*1
|
|
|
|
+ let nowTime = new Date().getTime()
|
|
|
|
+ if(nowTime - lastClickTime > 1000 * 5){
|
|
|
|
+ clearInterval(this.timeOut)
|
|
|
|
+ removeSession("SysList");
|
|
|
|
+ removeToken();
|
|
|
|
+ Cookies.remove("JSESSIONID");
|
|
|
|
+ this.userShow = false;
|
|
|
|
+ this.userMessage = null;
|
|
|
|
+ sessionStorage.removeItem("useragent_root_close");
|
|
|
|
+ window.location.href = 'https://gcls.helxsoft.cn/'
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ mounted(){
|
|
|
|
+ sessionStorage.setItem('lastClickTime',new Date().getTime())
|
|
|
|
+ this.isTimeOut()
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|