feat: 更新锁屏密码Basd64编码处理,无密码直接进入
This commit is contained in:
@@ -122,7 +122,6 @@ onMounted(() => {
|
||||
} else {
|
||||
data.alertHours = (data.alertHours / 24).toFixed(2);
|
||||
}
|
||||
console.log(data);
|
||||
modalState.passwdExpire = data;
|
||||
modalState.passwdExpireEnable = data.expHours > 0;
|
||||
} catch (error) {
|
||||
|
||||
@@ -130,7 +130,7 @@ export default {
|
||||
},
|
||||
LockScreen: {
|
||||
inputPlacePwd:'Lock Screen Password',
|
||||
validSucc:'Validation Passed',
|
||||
enter:'Enter',
|
||||
validError:'Validation Failure',
|
||||
backLogin:'Logout to Relogin',
|
||||
backReload:'Restarting now, please wait...',
|
||||
|
||||
@@ -130,7 +130,7 @@ export default {
|
||||
},
|
||||
LockScreen: {
|
||||
inputPlacePwd:'请输入锁屏密码',
|
||||
validSucc:'校验通过',
|
||||
enter:'进入',
|
||||
validError:'校验失败',
|
||||
backLogin:'退出并重新登录',
|
||||
backReload:'正在重启,请稍等...',
|
||||
|
||||
@@ -20,7 +20,7 @@ type MaskStateType = {
|
||||
const useMaskStore = defineStore('mask', {
|
||||
state: (): MaskStateType => ({
|
||||
type: (localGet(CACHE_LOCAL_MASK) || 'none') as MaskStateType['type'],
|
||||
lockPasswd: localGet(CACHE_LOCAL_LOCK_PASSWD) || '',
|
||||
lockPasswd: atob(localGet(CACHE_LOCAL_LOCK_PASSWD) || ''),
|
||||
lockTimeout: 0,
|
||||
}),
|
||||
getters: {},
|
||||
@@ -59,7 +59,7 @@ const useMaskStore = defineStore('mask', {
|
||||
}, 5_000);
|
||||
}
|
||||
if (type === 'lock') {
|
||||
localSet(CACHE_LOCAL_LOCK_PASSWD, this.lockPasswd);
|
||||
localSet(CACHE_LOCAL_LOCK_PASSWD, btoa(this.lockPasswd));
|
||||
} else {
|
||||
localRemove(CACHE_LOCAL_LOCK_PASSWD);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ const password = ref('');
|
||||
/**解锁 */
|
||||
function handleUnlock() {
|
||||
if (maskStore.lockPasswd === password.value) {
|
||||
message.success(t('components.LockScreen.validSucc'), 3);
|
||||
password.value = '';
|
||||
maskStore.handleMaskType('none');
|
||||
const redirectPath = route.query?.redirect || '/index';
|
||||
@@ -79,7 +78,7 @@ onMounted(() => {
|
||||
</span>
|
||||
</div>
|
||||
<div class="lock-screen_login-from">
|
||||
<a-input-group compact>
|
||||
<a-input-group compact v-if="maskStore.lockPasswd">
|
||||
<a-input
|
||||
type="password"
|
||||
v-model:value="password"
|
||||
@@ -92,6 +91,10 @@ onMounted(() => {
|
||||
<LoginOutlined />
|
||||
</a-button>
|
||||
</a-input-group>
|
||||
<a-button type="primary" block @click="handleUnlock" v-else>
|
||||
{{ t('components.LockScreen.enter') }}
|
||||
</a-button>
|
||||
|
||||
<a-button type="text" class="logout" @click="handleBackLogin">
|
||||
{{ t('components.LockScreen.backLogin') }}
|
||||
</a-button>
|
||||
|
||||
Reference in New Issue
Block a user