|  |  |  | 
|---|
|  |  |  | userInfo?: Nullable<API.LoginCommandCallback>; | 
|---|
|  |  |  | token?: Nullable<string>; | 
|---|
|  |  |  | refreshToken?: Nullable<string>; | 
|---|
|  |  |  | userDetail?: Nullable<API.UserInfoV2>; | 
|---|
|  |  |  | userDetail?: Nullable<API.GetEnterpriseLoginInfoQueryResult>; | 
|---|
|  |  |  | firstGetUserDetail?: boolean; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | locationCity?: string; | 
|---|
|  |  |  | 
|---|
|  |  |  | return getAccountInfoFromAccessToken(this.userInfo?.accessToken); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | userId: (state) => { | 
|---|
|  |  |  | return state.userDetail?.id; | 
|---|
|  |  |  | }, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // matchMakingIdentity(state): MatchMakingIdentityEnum { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // }, | 
|---|
|  |  |  | 
|---|
|  |  |  | encryptedData: detail.encryptedData, | 
|---|
|  |  |  | iv: detail.iv, | 
|---|
|  |  |  | sessionKey: wxMiniAppUserLoginRes.sessionKey, | 
|---|
|  |  |  | accessToken: wxMiniAppUserLoginRes.accessToken, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | res.accessToken = bindRes.accessToken; | 
|---|
|  |  |  | this.loginSuccess(res); | 
|---|
|  |  |  | 
|---|
|  |  |  | 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, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | this.setUserInfoAction(res); | 
|---|
|  |  |  | this.setTokenAction(res); | 
|---|
|  |  |  | // await this.getCurrentUserInfo(); | 
|---|
|  |  |  | await this.getCurrentUserInfo(); | 
|---|
|  |  |  | } catch (error) {} | 
|---|
|  |  |  | }, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | // } 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; | 
|---|
|  |  |  | 
|---|
|  |  |  | setUserInfo(info); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | setUserDetail(detail: API.UserInfoV2) { | 
|---|
|  |  |  | setUserDetail(detail: API.GetEnterpriseLoginInfoQueryResult) { | 
|---|
|  |  |  | this.userDetail = detail; | 
|---|
|  |  |  | setUserDetail(detail); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | logout() { | 
|---|
|  |  |  | this.resetState(); | 
|---|
|  |  |  | myClient.removeQueries(); | 
|---|
|  |  |  | // myClient.removeQueries(); | 
|---|
|  |  |  | goAuthorization(); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  |  | 
|---|