可通过配置取消自动锁屏
This commit is contained in:
@@ -70,7 +70,12 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
resetTimeout();
|
if (timeoutDuration !== 0) {
|
||||||
|
resetTimeout();
|
||||||
|
// 监听用户的操作,重置超时时间
|
||||||
|
window.addEventListener('mousemove', resetTimeout);
|
||||||
|
window.addEventListener('keydown', resetTimeout);
|
||||||
|
}
|
||||||
if (localGet(CACHE_LOCAL_LOCK) && getToken()) {
|
if (localGet(CACHE_LOCAL_LOCK) && getToken()) {
|
||||||
isLocked.value = localGet(CACHE_LOCAL_LOCK) === 'false' ? false : true;
|
isLocked.value = localGet(CACHE_LOCAL_LOCK) === 'false' ? false : true;
|
||||||
}
|
}
|
||||||
@@ -84,10 +89,6 @@ onUnmounted(() => {
|
|||||||
}
|
}
|
||||||
localRemove(CACHE_LOCAL_LOCK);
|
localRemove(CACHE_LOCAL_LOCK);
|
||||||
});
|
});
|
||||||
|
|
||||||
// 监听用户的操作,重置超时时间
|
|
||||||
window.addEventListener('mousemove', resetTimeout);
|
|
||||||
window.addEventListener('keydown', resetTimeout);
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<a-button type="text" @click="fnLock">
|
<a-button type="text" @click="fnLock">
|
||||||
|
|||||||
Reference in New Issue
Block a user