mirror of https://github.com/jeecgboot/jeecg-boot
🎨 格式化LockPage.vue避免eslint报错
parent
4477f03cf3
commit
4be0f376cb
|
@ -30,15 +30,21 @@
|
|||
{{ userinfo.realname }}
|
||||
</p>
|
||||
</div>
|
||||
<InputPassword @change="unLock('change')" @keyup.enter="unLock('enter')" :placeholder="t('sys.lock.placeholder')" class="enter-x" v-model:value="password" />
|
||||
<InputPassword
|
||||
@change="unLock('change')"
|
||||
@keyup.enter="unLock('enter')"
|
||||
:placeholder="t('sys.lock.placeholder')"
|
||||
class="enter-x"
|
||||
v-model:value="password"
|
||||
/>
|
||||
<span :class="`${prefixCls}-entry__err-msg enter-x`" v-if="errMsg">
|
||||
{{ t('sys.lock.alert') }}
|
||||
</span>
|
||||
<div :class="`${prefixCls}-entry__footer enter-x`" style="justify-content:center;margin-top: 4px">
|
||||
<div :class="`${prefixCls}-entry__footer enter-x`" style="justify-content: center; margin-top: 4px">
|
||||
<!-- <a-button type="link" size="small" class="mt-2 mr-2 enter-x" :disabled="loading" @click="handleShowForm(true)">
|
||||
{{ t('common.back') }}
|
||||
</a-button>-->
|
||||
<a-button type="link" size="small" :disabled="loading" @click="goLogin">
|
||||
<a-button type="link" size="small" :disabled="loading" @click="goLogin">
|
||||
{{ t('sys.lock.backToLogin') }}
|
||||
</a-button>
|
||||
<!-- <a-button class="mt-2" type="link" size="small" @click="unLock()" :loading="loading">
|
||||
|
@ -58,7 +64,7 @@
|
|||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import {ref, computed, onMounted, onUnmounted} from 'vue';
|
||||
import { ref, computed, onMounted, onUnmounted } from 'vue';
|
||||
import { Input } from 'ant-design-vue';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { useLockStore } from '/@/store/modules/lock';
|
||||
|
@ -89,7 +95,7 @@ import {ref, computed, onMounted, onUnmounted} from 'vue';
|
|||
|
||||
/**
|
||||
* @description: unLock
|
||||
*
|
||||
*
|
||||
* @param type enter 回车 change input值发生改变 不提示锁屏密码错误
|
||||
*/
|
||||
async function unLock(type) {
|
||||
|
@ -100,7 +106,7 @@ import {ref, computed, onMounted, onUnmounted} from 'vue';
|
|||
try {
|
||||
loading.value = true;
|
||||
const res = await lockStore.unLock(pwd);
|
||||
if(type === 'enter'){
|
||||
if (type === 'enter') {
|
||||
errMsg.value = !res;
|
||||
}
|
||||
} finally {
|
||||
|
@ -119,7 +125,7 @@ import {ref, computed, onMounted, onUnmounted} from 'vue';
|
|||
|
||||
/**
|
||||
* 监听键盘触发事件
|
||||
*
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
function handleKeyDown(event) {
|
||||
|
@ -129,15 +135,14 @@ import {ref, computed, onMounted, onUnmounted} from 'vue';
|
|||
password.value = '';
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(()=>{
|
||||
|
||||
onMounted(() => {
|
||||
window.addEventListener('keydown', handleKeyDown);
|
||||
})
|
||||
});
|
||||
|
||||
onUnmounted(()=>{
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('keydown', handleKeyDown);
|
||||
})
|
||||
|
||||
});
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
@prefix-cls: ~'@{namespace}-lock-page';
|
||||
|
|
Loading…
Reference in New Issue