From 2a681aed4c274560c04ab3699a4ace88abefcb90 Mon Sep 17 00:00:00 2001 From: zhengyiming <540361168@qq.com> Date: 星期五, 08 八月 2025 18:16:21 +0800 Subject: [PATCH] fix: 修改 --- src/store/modules/user.ts | 20 +++++++++++--------- 1 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 40aa7bf..c9364bf 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -18,7 +18,7 @@ export interface UserState { token: string; - userInfo: API.PasswordLoginCommandCallback; + userInfo: API.LoginCommandCallback; } function getDefaultState() { @@ -42,31 +42,33 @@ return state.userInfo; }, - // userId(state) { - // return state.accountInfo.sub; - // }, + userId(state) { + //TODO + return ''; + }, }, actions: { setToken(token: string) { this.token = token; setToken(token); }, - setUserInfo(userInfo: API.PasswordLoginCommandCallback) { + setUserInfo(userInfo: API.LoginCommandCallback) { this.userInfo = userInfo; setUserInfo(userInfo); }, // 鐢ㄦ埛鐧诲叆 async loginByUsername(params: API.PasswordLoginCommand) { - let res = await authServices.authPasswordLogin( + let res = await authServices.passwordLogin( { ...params, password: md5Encrypt(params.password), - type: EnumUserType.Operation, - clientType: EnumClientType.PcWeb, + type: AppLocalConfig.userType, + clientType: AppLocalConfig.clientType, }, { showLoading: false, + skipErrorHandler: true, } ); if (res) { @@ -107,7 +109,7 @@ Object.assign(this, getDefaultState()); }, - async refreshToken(params: API.AccessRefreshToken) { + async refreshToken(params: any) { return Promise.resolve({ accessToken: '1222', expiresIn: 1000 * 60 * 24 * 60, -- Gitblit v1.9.1