diff --git a/src/App.vue b/src/App.vue index 4c2723f47e279262b066ee158b9c51116189d2c0..dc4b9a9401d49437a7f31158a03b8e42e9432dab 100644 --- a/src/App.vue +++ b/src/App.vue @@ -113,65 +113,15 @@ export default { }, created() { // this.initMsg() + // 用户登录状态有效检测 + setInterval(() => { + $axios.get("/apaas/system/v5/user/login/check"); + }, 15 * 1000); }, mounted() { // this.getSysOptions(); }, methods: { - /** - * 设置用户多久不操作就跳转到登录界面 - * limit:用户无操作时常限制(分钟) - */ - - // exitSystemAfterLimit(limit) { - // window.lastOperateTime = new Date(); - // window.onload = this.addOperateListener; - // this.setTimer(limit); - // }, - //绑定用户操作事件 - // addOperateListener() { - // document.addEventListener("mousemove", this.resetStartTime); - // document.addEventListener("keydown", this.resetStartTime); - // document.addEventListener("scroll", this.resetStartTime); - // document.addEventListener("touchstart", this.resetStartTime); - // }, - //重置起始时间 - // resetStartTime() { - // window.lastOperateTime = new Date(); - // }, - //设置定时器 - // setTimer(limit) { - // window.logTimer = setInterval(() => { - // var currentTime = new Date(); - // var timeDiff = currentTime.getTime() - lastOperateTime.getTime(); - // if (timeDiff > limit * 60 * 1000) { - // clearInterval(window.logTimer); - // this.$axios.post(`/apaas/system/v5/user/logout`).then((res) => { - // if (res.data.code == "200") { - // window.location.href = `/apaas/manage/ui/#/login`; - // this.$store.commit("setUserInfo", null); - // clearCookie("bgToken"); - // this.$message.success("退出成功"); - // resetRouter(); - // } else { - // this.$message.error("退出失败"); - // } - // }); - // } - // }, 1000); - // }, - - // getSysOptions() { - // this.$axios.get(`/apaas/system/v5/sysOptions`).then((res) => { - // if (res.data.code == 200) { - // const result = res.data.data || {}; - // if (result.session_validity) this.exitSystemAfterLimit(result.session_validity); - // } else { - // this.$message.error(res.data.data); - // } - // }); - // }, - openMsg(data) { this.readFlag = !this.readFlag; },