| | |
| | | import { getAccountInfoFromAccessToken, AccountInfo, setOSSLink } from '@life-payment/utils'; |
| | | import DefaultAvatar from '@/assets/components/icon-default-avatar.png'; |
| | | import { myClient } from '@/constants/query'; |
| | | import { blLifeRecharge } from '@/utils/blLifeRecharge'; |
| | | import { LifePayPhoneMesssageCodeLoginOutput } from '@life-payment/core-vue'; |
| | | |
| | | interface UserState { |
| | | userInfo?: Nullable<API.IdentityModelTokenCacheItem>; |
| | |
| | | |
| | | wxCode?: string; |
| | | wxOpenId?: string; |
| | | |
| | | virtualUserInfo?: LifePayPhoneMesssageCodeLoginOutput; |
| | | } |
| | | |
| | | const goAuthorization = debounce( |
| | |
| | | |
| | | if (res) { |
| | | this.loginVirtualSuccess({ |
| | | virtualUserId: res, |
| | | virtualUserId: res.userId, |
| | | virtualPhoneNumber: data.phoneNumber, |
| | | }); |
| | | } |
| | |
| | | async loginVirtualSuccess(virtualUserRes: LoginVirtualRes) { |
| | | try { |
| | | this.setVirtualUserId(virtualUserRes); |
| | | this.getCurrentUserInfo(); |
| | | } catch (error) {} |
| | | }, |
| | | |
| | |
| | | |
| | | async getCurrentUserInfo() { |
| | | try { |
| | | // let res = await userServices.getUserInfo({ showLoading: false }); |
| | | // let res = await blLifeRecharge.accountModel.getUserInfo(this.virtualUserId); |
| | | // if (res) { |
| | | // res.originalAvatarUrl = res.avatarUrl; |
| | | // res.avatarUrl = res.avatarUrl ? setOSSLink(res.avatarUrl) : DefaultAvatar; |
| | | // this.setUserDetail(res); |
| | | // // this.setUserDetail(res); |
| | | // this.virtualUserInfo = res; |
| | | // this.firstGetUserDetail = false; |
| | | // } |
| | | } catch (error) {} |