From bf355b3fbfc313bb74c48486dbb0c969bb6602db Mon Sep 17 00:00:00 2001 From: bestlee Date: Tue, 18 Aug 2026 15:00:02 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=8E=A5=E5=8F=A3=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 4 ++-- src/layouts/modules/global-header/components/user-avatar.vue | 2 +- src/layouts/modules/global-header/index.vue | 4 ++-- src/service/api/auth.ts | 2 +- src/store/modules/auth/index.ts | 3 +-- src/typings/api/auth.d.ts | 2 +- src/views/login/modules/pwd-login.vue | 2 +- 7 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.env b/.env index 2d2e251..81c69d0 100644 --- a/.env +++ b/.env @@ -29,7 +29,7 @@ VITE_HTTP_PROXY=N VITE_ROUTER_HISTORY_MODE=history # success code of backend service, when the code is received, the request is successful -VITE_SERVICE_SUCCESS_CODE=0000 +VITE_SERVICE_SUCCESS_CODE=0 # logout codes of backend service, when the code is received, the user will be logged out and redirected to login page VITE_SERVICE_LOGOUT_CODES=8888,8889 @@ -47,7 +47,7 @@ VITE_STATIC_SUPER_ROLE=R_SUPER VITE_SOURCE_MAP=N # Used to differentiate storage across different domains -VITE_STORAGE_PREFIX=SOY_ +VITE_STORAGE_PREFIX= # used to control whether the program automatically detects updates VITE_AUTOMATICALLY_DETECT_UPDATE=Y diff --git a/src/layouts/modules/global-header/components/user-avatar.vue b/src/layouts/modules/global-header/components/user-avatar.vue index 8c8e39d..4b89bdd 100644 --- a/src/layouts/modules/global-header/components/user-avatar.vue +++ b/src/layouts/modules/global-header/components/user-avatar.vue @@ -81,7 +81,7 @@ function handleDropdown(key: DropdownKey) {
- {{ authStore.userInfo.userName }} + {{ authStore.userInfo.username }}
diff --git a/src/layouts/modules/global-header/index.vue b/src/layouts/modules/global-header/index.vue index d1e680a..753bd84 100644 --- a/src/layouts/modules/global-header/index.vue +++ b/src/layouts/modules/global-header/index.vue @@ -46,12 +46,12 @@ const { isFullscreen, toggle } = useFullscreen(); :lang-options="appStore.localeOptions" @change-lang="appStore.changeLocale" /> - - + --> diff --git a/src/service/api/auth.ts b/src/service/api/auth.ts index 4e742b6..90765cd 100644 --- a/src/service/api/auth.ts +++ b/src/service/api/auth.ts @@ -19,7 +19,7 @@ export function fetchLogin(username: string, password: string) { /** Get user info */ export function fetchGetUserInfo() { - return request({ url: '/auth/getUserInfo' }); + return request({ url: '/api/auth/me' }); } /** diff --git a/src/store/modules/auth/index.ts b/src/store/modules/auth/index.ts index 9791d9b..8fb9117 100644 --- a/src/store/modules/auth/index.ts +++ b/src/store/modules/auth/index.ts @@ -22,7 +22,7 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => { const userInfo: Api.Auth.UserInfo = reactive({ userId: '', - userName: '', + username: '', roles: [], buttons: [] }); @@ -130,7 +130,6 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => { async function loginByToken(loginToken: Api.Auth.LoginToken) { // 1. stored in the localStorage, the later requests need it in headers localStg.set('token', loginToken.token); - localStg.set('refreshToken', loginToken.refreshToken); // 2. get user info const pass = await getUserInfo(); diff --git a/src/typings/api/auth.d.ts b/src/typings/api/auth.d.ts index 1ff174b..0fbb802 100644 --- a/src/typings/api/auth.d.ts +++ b/src/typings/api/auth.d.ts @@ -12,7 +12,7 @@ declare namespace Api { interface UserInfo { userId: string; - userName: string; + username: string; roles: string[]; buttons: string[]; } diff --git a/src/views/login/modules/pwd-login.vue b/src/views/login/modules/pwd-login.vue index e586712..131e82e 100644 --- a/src/views/login/modules/pwd-login.vue +++ b/src/views/login/modules/pwd-login.vue @@ -16,7 +16,7 @@ interface FormModel { } const model: FormModel = reactive({ - userName: 'Soybean', + userName: 'admin1', password: '123456' });