fix(登录): 🐛 自动登录导致登录错误问题

This commit is contained in:
猿小天
2023-04-28 17:34:05 +08:00
parent c9fddbd4a7
commit 111ca9554c
2 changed files with 12 additions and 5 deletions

View File

@@ -12,7 +12,6 @@
:type="isShowPassword ? 'text' : 'password'" :type="isShowPassword ? 'text' : 'password'"
:placeholder="$t('message.account.accountPlaceholder2')" :placeholder="$t('message.account.accountPlaceholder2')"
v-model="ruleForm.password" v-model="ruleForm.password"
autocomplete="off"
> >
<template #prefix> <template #prefix>
<el-icon class="el-input__icon"><ele-Unlock /></el-icon> <el-icon class="el-input__icon"><ele-Unlock /></el-icon>
@@ -50,7 +49,7 @@
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item class="login-animation4"> <el-form-item class="login-animation4">
<el-button type="primary" class="login-content-submit" round @click="loginClick" :loading="loading.signIn"> <el-button type="primary" class="login-content-submit" round @click.enter="loginClick" :loading="loading.signIn">
<span>{{ $t('message.account.accountBtnText') }}</span> <span>{{ $t('message.account.accountBtnText') }}</span>
</el-button> </el-button>
</el-form-item> </el-form-item>
@@ -182,10 +181,10 @@ export default defineComponent({
getCaptcha(); getCaptcha();
//获取系统配置 //获取系统配置
SystemConfigStore().getSystemConfigs(); SystemConfigStore().getSystemConfigs();
window.addEventListener('keyup', enterClickLogin, false); // window.addEventListener('keyup', enterClickLogin, false);
}); });
onUnmounted(() => { onUnmounted(() => {
window.removeEventListener('keyup', enterClickLogin, false); // window.removeEventListener('keyup', enterClickLogin, false);
}); });
return { return {

View File

@@ -21,7 +21,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
}; };
//权限判定 //权限判定
const hasPermissions = inject('$hasPermissions'); const hasPermissions:any = inject('$hasPermissions');
return { return {
crudOptions: { crudOptions: {
@@ -36,6 +36,14 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
editRequest, editRequest,
delRequest, delRequest,
}, },
actionbar: {
buttons: {
add: {
show: hasPermissions('user:Create')
// show:true
}
}
},
rowHandle: { rowHandle: {
//固定右侧 //固定右侧
fixed: 'right', fixed: 'right',