From 84aedf23b13386576a70b21ebdf5d6ddd9c947ec Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期一, 20 十月 2025 09:43:32 +0800
Subject: [PATCH] fix: bug
---
apps/bMiniApp/src/stores/modules/user.ts | 46 ++++++++++++++++++++++++++--------------------
1 files changed, 26 insertions(+), 20 deletions(-)
diff --git a/apps/bMiniApp/src/stores/modules/user.ts b/apps/bMiniApp/src/stores/modules/user.ts
index 405d027..58c2255 100644
--- a/apps/bMiniApp/src/stores/modules/user.ts
+++ b/apps/bMiniApp/src/stores/modules/user.ts
@@ -31,7 +31,7 @@
userInfo?: Nullable<API.LoginCommandCallback>;
token?: Nullable<string>;
refreshToken?: Nullable<string>;
- userDetail?: Nullable<API.UserInfoV2>;
+ userDetail?: Nullable<API.GetEnterpriseLoginInfoQueryResult>;
firstGetUserDetail?: boolean;
locationCity?: string;
@@ -85,6 +85,10 @@
return getAccountInfoFromAccessToken(this.userInfo?.accessToken);
},
+ userId: (state) => {
+ return state.userDetail?.id;
+ },
+
// matchMakingIdentity(state): MatchMakingIdentityEnum {
// },
@@ -102,6 +106,7 @@
encryptedData: detail.encryptedData,
iv: detail.iv,
sessionKey: wxMiniAppUserLoginRes.sessionKey,
+ accessToken: wxMiniAppUserLoginRes.accessToken,
});
res.accessToken = bindRes.accessToken;
this.loginSuccess(res);
@@ -135,7 +140,8 @@
let res = await authServices.passwordLogin(
{
userName: params.userName,
- password: md5Encrypt(params.password),
+ password: params.password,
+ // password: md5Encrypt(params.password),
type: AppLocalConfig.userType,
clientType: AppLocalConfig.clientType,
},
@@ -151,7 +157,7 @@
try {
this.setUserInfoAction(res);
this.setTokenAction(res);
- // await this.getCurrentUserInfo();
+ await this.getCurrentUserInfo();
} catch (error) {}
},
@@ -186,21 +192,21 @@
// } catch (error) {}
},
- // async getCurrentUserInfo() {
- // try {
- // let res = await userServices.getUserInfo({ showLoading: false });
- // if (res) {
- // res.frontStatus = getUserCertificationFrontStatusAdapter(
- // res.userCertificationStatus,
- // res.userCertificationAuditStatus
- // );
- // res.originalAvatarUrl = res.avatarUrl;
- // res.avatarUrl = res.avatarUrl ? setOSSLink(res.avatarUrl) : DefaultAvatar;
- // this.setUserDetail(res);
- // this.firstGetUserDetail = false;
- // }
- // } catch (error) {}
- // },
+ async getCurrentUserInfo() {
+ try {
+ let res = await authServices.getEnterpriseLoginInfo({}, { showLoading: false });
+ if (res) {
+ // res.frontStatus = getUserCertificationFrontStatusAdapter(
+ // res.userCertificationStatus,
+ // res.userCertificationAuditStatus
+ // );
+ res.originalAvatar = res.avatar;
+ res.avatar = res.avatar ? setOSSLink(res.avatar) : DefaultAvatar;
+ this.setUserDetail(res);
+ this.firstGetUserDetail = false;
+ }
+ } catch (error) {}
+ },
setTokenAction(tokenInfo: API.IdentityModelTokenCacheItem) {
this.token = tokenInfo?.accessToken;
@@ -212,7 +218,7 @@
setUserInfo(info);
},
- setUserDetail(detail: API.UserInfoV2) {
+ setUserDetail(detail: API.GetEnterpriseLoginInfoQueryResult) {
this.userDetail = detail;
setUserDetail(detail);
},
@@ -231,7 +237,7 @@
*/
logout() {
this.resetState();
- myClient.removeQueries();
+ // myClient.removeQueries();
goAuthorization();
},
--
Gitblit v1.9.1