| | |
| | | import config from '@/utils/config.js'; |
| | | const { ukey, face } = config; |
| | | |
| | | const throttleConect = throttle(pingpong, 1000); |
| | | const throttleConect = throttle(pingpong, 1000); |
| | | |
| | | export default defineComponent({ |
| | | name: "LayoutIndex", |
| | |
| | | }, |
| | | immediate: true, |
| | | }, |
| | | isIn: { |
| | | async handler(val) { |
| | | if (ukey && !val) { |
| | | await store.user().logout(); |
| | | // console.log('logout', '============='); |
| | | |
| | | router.push(`/login?redirect=${route.fullPath}`); |
| | | } |
| | | }, |
| | | immediate: true |
| | | } |
| | | isIn: { |
| | | async handler(val) { |
| | | if (ukey && !val) { |
| | | await store.user().logout(); |
| | | // console.log('logout', '============='); |
| | | |
| | | router.push(`/login?redirect=${route.fullPath}`); |
| | | } |
| | | }, |
| | | immediate: true |
| | | } |
| | | }, |
| | | mixins: [ResizeMixin], |
| | | computed: { |
| | |
| | | fixedHeader: "fixedHeader", |
| | | secondMenuPopup: "secondMenuPopup", |
| | | }), |
| | | ...mapState(store.user, ['name', 'sessionid']), |
| | | classObj() { |
| | | return { |
| | | hideSidebar: !this.sidebar.opened, |
| | |
| | | changeTheme(this.theme); |
| | | }, |
| | | mounted() { |
| | | document.addEventListener("click", throttleConect); |
| | | document.addEventListener("mousemove", throttleConect); |
| | | document.addEventListener("keydown", throttleConect); |
| | | document.addEventListener("click", () => throttleConect(this.sessionid, this.name)); |
| | | document.addEventListener("mousemove", () => throttleConect(this.sessionid, this.name)); |
| | | document.addEventListener("keydown", () => throttleConect(this.sessionid, this.name)); |
| | | }, |
| | | unMounted() { |
| | | document.removeEventListener("click", throttleConect); |
| | | document.removeEventListener("mousemove", throttleConect); |
| | | document.removeEventListener("keydown", throttleConect); |
| | | document.removeEventListener("click", () => throttleConect(this.sessionid, this.name)); |
| | | document.removeEventListener("mousemove", () => throttleConect(this.sessionid, this.name)); |
| | | document.removeEventListener("keydown", () => throttleConect(this.sessionid, this.name)); |
| | | }, |
| | | }); |
| | | </script> |