From a5080912b5f5815fd9690dbdb69f63ab5b3ede69 Mon Sep 17 00:00:00 2001 From: MSuMshk <2039814060@qq.com> Date: Fri, 6 Feb 2026 15:53:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=A5=E6=A0=BC=E6=8C=89=E5=90=8E?= =?UTF-8?q?=E7=AB=AFaccount=E5=AD=97=E6=AE=B5=E4=BF=AE=E5=A4=8D=E8=AE=B0?= =?UTF-8?q?=E4=BD=8F=E8=B4=A6=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-antd/src/api/core/auth.ts | 8 +++----- .../common-ui/src/ui/authentication/login.vue | 12 ++++++------ 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/apps/web-antd/src/api/core/auth.ts b/apps/web-antd/src/api/core/auth.ts index 567f71a..707c037 100644 --- a/apps/web-antd/src/api/core/auth.ts +++ b/apps/web-antd/src/api/core/auth.ts @@ -14,9 +14,8 @@ export namespace AuthApi { /** 登录接口参数 */ export interface LoginParams { - account?: string; - password?: string; - username?: string; + account: string; + password: string; } /** 登录接口返回值 */ @@ -45,9 +44,8 @@ export namespace AuthApi { * 登录 */ export async function loginApi(data: AuthApi.LoginParams) { - const account = data.account ?? data.username; return requestClient.post('/auth/login', { - account, + account: data.account, password: data.password, }); } diff --git a/packages/effects/common-ui/src/ui/authentication/login.vue b/packages/effects/common-ui/src/ui/authentication/login.vue index bcb8f21..34b4d81 100644 --- a/packages/effects/common-ui/src/ui/authentication/login.vue +++ b/packages/effects/common-ui/src/ui/authentication/login.vue @@ -58,11 +58,11 @@ const [Form, formApi] = useVbenForm( ); const router = useRouter(); -const REMEMBER_ME_KEY = `REMEMBER_ME_USERNAME_${location.hostname}`; +const REMEMBER_ME_KEY = `REMEMBER_ME_ACCOUNT_${location.hostname}`; -const localUsername = localStorage.getItem(REMEMBER_ME_KEY) || ''; +const localAccount = localStorage.getItem(REMEMBER_ME_KEY) || ''; -const rememberMe = ref(!!localUsername); +const rememberMe = ref(!!localAccount); async function handleSubmit() { const { valid } = await formApi.validate(); @@ -70,7 +70,7 @@ async function handleSubmit() { if (valid) { localStorage.setItem( REMEMBER_ME_KEY, - rememberMe.value ? values?.username : '', + rememberMe.value ? values?.account : '', ); emit('submit', values); } @@ -81,8 +81,8 @@ function handleGo(path: string) { } onMounted(() => { - if (localUsername) { - formApi.setFieldValue('username', localUsername); + if (localAccount) { + formApi.setFieldValue('account', localAccount); } });