fix: 锁屏密码base处理,无密码进入
This commit is contained in:
@@ -20,7 +20,7 @@ type MaskStateType = {
|
|||||||
const useMaskStore = defineStore('mask', {
|
const useMaskStore = defineStore('mask', {
|
||||||
state: (): MaskStateType => ({
|
state: (): MaskStateType => ({
|
||||||
type: (localGet(CACHE_LOCAL_MASK) || 'none') as MaskStateType['type'],
|
type: (localGet(CACHE_LOCAL_MASK) || 'none') as MaskStateType['type'],
|
||||||
lockPasswd: localGet(CACHE_LOCAL_LOCK_PASSWD) || '',
|
lockPasswd: atob(localGet(CACHE_LOCAL_LOCK_PASSWD) || ''),
|
||||||
lockTimeout: 0,
|
lockTimeout: 0,
|
||||||
}),
|
}),
|
||||||
getters: {},
|
getters: {},
|
||||||
@@ -59,7 +59,7 @@ const useMaskStore = defineStore('mask', {
|
|||||||
}, 5_000);
|
}, 5_000);
|
||||||
}
|
}
|
||||||
if (type === 'lock') {
|
if (type === 'lock') {
|
||||||
localSet(CACHE_LOCAL_LOCK_PASSWD, this.lockPasswd);
|
localSet(CACHE_LOCAL_LOCK_PASSWD, btoa(this.lockPasswd));
|
||||||
} else {
|
} else {
|
||||||
localRemove(CACHE_LOCAL_LOCK_PASSWD);
|
localRemove(CACHE_LOCAL_LOCK_PASSWD);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ onMounted(() => {
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="lock-screen_login-from">
|
<div class="lock-screen_login-from">
|
||||||
<a-input-group compact>
|
<a-input-group compact v-if="maskStore.lockPasswd">
|
||||||
<a-input
|
<a-input
|
||||||
type="password"
|
type="password"
|
||||||
v-model:value="password"
|
v-model:value="password"
|
||||||
@@ -87,7 +87,10 @@ onMounted(() => {
|
|||||||
:maxlength="32"
|
:maxlength="32"
|
||||||
style="width: calc(100% - 50px)"
|
style="width: calc(100% - 50px)"
|
||||||
@keyup.enter="handleUnlock"
|
@keyup.enter="handleUnlock"
|
||||||
/>
|
></a-input>
|
||||||
|
<a-button type="primary" block @click="handleUnlock" v-else>
|
||||||
|
{{ t('components.LockScreen.enter') }}
|
||||||
|
</a-button>
|
||||||
<a-button type="primary" @click="handleUnlock">
|
<a-button type="primary" @click="handleUnlock">
|
||||||
<LoginOutlined />
|
<LoginOutlined />
|
||||||
</a-button>
|
</a-button>
|
||||||
|
|||||||
Reference in New Issue
Block a user