diff --git a/src/components/LockScreen/index.vue b/src/components/LockScreen/index.vue index 1e97b8ee..ca085457 100644 --- a/src/components/LockScreen/index.vue +++ b/src/components/LockScreen/index.vue @@ -71,6 +71,8 @@ onMounted(() => { // 本地锁定同时是登录状态 if (lockedStore.type === 'lock' && getToken()) { lockedStore.fnLock('lock'); + } else if (lockedStore.type === 'reload') { + lockedStore.relaodWait(); } }); }); diff --git a/src/store/modules/locked.ts b/src/store/modules/locked.ts index d5e3527e..3e0cdde7 100644 --- a/src/store/modules/locked.ts +++ b/src/store/modules/locked.ts @@ -21,11 +21,13 @@ const useLockedStore = defineStore('locked', { actions: { // 重启等待-轮询 async relaodWait() { - const res = await getSysConf(); - if (res.code === RESULT_CODE_SUCCESS && res.data) { - this.fnLock('none'); - window.location.reload(); - } else { + try { + const res = await getSysConf(); + if (res.code === RESULT_CODE_SUCCESS && res.data) { + this.fnLock('none'); + window.location.reload(); + } + } catch (e) { // 延迟5秒 setTimeout(() => { this.relaodWait();