diff --git a/src/App.vue b/src/App.vue index 3d95200..a78bfaa 100644 --- a/src/App.vue +++ b/src/App.vue @@ -20,6 +20,10 @@ export default { }; }, created () { + window.exitSystem = () => { + sessionStorage.removeItem('token') + location.reload() + } //在页面加载时读取sessionStorage里的状态信息 if (sessionStorage.getItem("store")) { this.$store.replaceState(Object.assign({}, this.$store.state, JSON.parse(sessionStorage.getItem("store")))) diff --git a/src/components/Header.vue b/src/components/Header.vue index 7cc176b..b1d15ae 100644 --- a/src/components/Header.vue +++ b/src/components/Header.vue @@ -21,6 +21,7 @@ import Setting from '@/setting' export default { data () { return { + timer: null, Setting, userName: '', }; @@ -81,8 +82,8 @@ export default { }, // 心跳检测 heartbeatDetection () { - setInterval(async () => { - await this.$get(this.api.heartbeatDetection) + this.timer = setInterval(async () => { + sessionStorage.getItem('token') ? await this.$get(this.api.heartbeatDetection) : clearInterval(this.timer) }, 58 * 1000) }, diff --git a/src/setting.js b/src/setting.js index 77f0b79..ab9dacd 100644 --- a/src/setting.js +++ b/src/setting.js @@ -51,7 +51,7 @@ const Setting = { isDev, isPro, // 是否使用动态路由 - dynamicRoute: false, + dynamicRoute: true, /** * @description 默认密码 */ diff --git a/src/utils/api.js b/src/utils/api.js index 24df619..dce2be0 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -17,7 +17,7 @@ export default { logout: `users/users/user/logout`, // 阿里云文件/视频管理 - getPlayAuth: `${uploadURL}oss/manage/getPlayAuth`, // 获取播放凭证 + getPlayAuth: `nakadai/nakadai/oss/getPlayAuth`, // 获取播放凭证 encrypt: `nakadai/data/encrypt`, staffTemplate: `https://occupationlab.com/template/%E6%89%B9%E9%87%8F%E5%AF%BC%E5%85%A5%E5%91%98%E5%B7%A5%E6%A8%A1%E6%9D%BF.xlsx`, // 后台账号模板 diff --git a/src/views/Login.vue b/src/views/Login.vue index e892dd3..3392e47 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -199,6 +199,7 @@ export default { this.$refs[ref].validate(valid => { if (valid) { this.$post(this.api.logins, param).then(({ status, data, message }) => { + localStorage.removeItem('examPath') if (status == 200) { const accounts = data.userAccounts // 如果返回的是数组,则弹框给用户选择登录哪个用户,否则,直接登录 diff --git a/src/views/match/add/index.vue b/src/views/match/add/index.vue index 2c4fcf8..61e1174 100644 --- a/src/views/match/add/index.vue +++ b/src/views/match/add/index.vue @@ -9,8 +9,8 @@
大赛发布类型
- 仅发布信息 - 设置完整比赛 + {{ item.name + }} - -
-
- - - + +
- - 个人赛 - 团队赛 - - -
- - 人 -
-
- -
+
【知识点】 - {{ kp }} + {{ kp.name }}
【解析】 @@ -161,16 +168,16 @@