From 00b1a7434b5fd2d2f003340c0b66f5fc57716fea Mon Sep 17 00:00:00 2001 From: wupengfei <834520024@qq.com> Date: 星期二, 19 八月 2025 16:01:47 +0800 Subject: [PATCH] fix: bug --- src/store/modules/user.ts | 22 ++++++++++++---------- 1 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 40aa7bf..d2204f3 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,28 +42,30 @@ 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, + password: params.password, + // password: md5Encrypt(params.password), + type: AppLocalConfig.userType, + clientType: AppLocalConfig.clientType, }, { showLoading: false, @@ -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