fix: 锁屏重启判断

This commit is contained in:
TsMask committed 2024-01-18 11:28:12 +08:00
1 parent 0acb4109e5
commit 13738d5b4e
2 files changed
+9 -5

No files matched your search

+2
View File
@@ -71,6 +71,8 @@ onMounted(() => {
// 本地锁定同时是登录状态
if (lockedStore.type === 'lock' && getToken()) {
lockedStore.fnLock('lock');
} else if (lockedStore.type === 'reload') {
lockedStore.relaodWait();
}
});
});
+7 -5
View File
@@ -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();