fix: 锁屏重启判断
This commit is contained in:
@@ -71,6 +71,8 @@ onMounted(() => {
|
|||||||
// 本地锁定同时是登录状态
|
// 本地锁定同时是登录状态
|
||||||
if (lockedStore.type === 'lock' && getToken()) {
|
if (lockedStore.type === 'lock' && getToken()) {
|
||||||
lockedStore.fnLock('lock');
|
lockedStore.fnLock('lock');
|
||||||
|
} else if (lockedStore.type === 'reload') {
|
||||||
|
lockedStore.relaodWait();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -21,11 +21,13 @@ const useLockedStore = defineStore('locked', {
|
|||||||
actions: {
|
actions: {
|
||||||
// 重启等待-轮询
|
// 重启等待-轮询
|
||||||
async relaodWait() {
|
async relaodWait() {
|
||||||
const res = await getSysConf();
|
try {
|
||||||
if (res.code === RESULT_CODE_SUCCESS && res.data) {
|
const res = await getSysConf();
|
||||||
this.fnLock('none');
|
if (res.code === RESULT_CODE_SUCCESS && res.data) {
|
||||||
window.location.reload();
|
this.fnLock('none');
|
||||||
} else {
|
window.location.reload();
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
// 延迟5秒
|
// 延迟5秒
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.relaodWait();
|
this.relaodWait();
|
||||||
|
|||||||
Reference in New Issue
Block a user