| | |
| | | setUserDetail, |
| | | getUserDetail, |
| | | removeUserDetail, |
| | | setStorageVirtualUserId, |
| | | getStorageVirtualUserId, |
| | | removeStorageVirtualUserId, |
| | | } from '@/utils/storage/auth'; |
| | | import * as accountServices from '@life-payment/services/api/Account'; |
| | | import * as userServices from '@life-payment/services/api/User'; |
| | |
| | | locationCity?: string; |
| | | locationProvince?: string; |
| | | firstSetLocation?: boolean; |
| | | |
| | | virtualUserId?: string; |
| | | } |
| | | |
| | | const goAuthorization = debounce( |
| | |
| | | refreshToken: userInfo?.refreshToken ?? '', |
| | | userDetail: userDetail, |
| | | firstGetUserDetail: true, |
| | | |
| | | virtualUserId: getStorageVirtualUserId() ?? '', |
| | | }; |
| | | }, |
| | | getters: { |
| | |
| | | ); |
| | | |
| | | if (res) { |
| | | this.loginSuccess(res); |
| | | this.loginVirtualSuccess(res); |
| | | } |
| | | return res; |
| | | }, |
| | |
| | | return res; |
| | | }, |
| | | |
| | | async loginSuccess(res: API.IdentityModelTokenCacheItem | string) { |
| | | async loginSuccess(res: API.IdentityModelTokenCacheItem) { |
| | | console.log('res: ', res); |
| | | // try { |
| | | // this.setUserInfoAction(res); |
| | | // this.setTokenAction(res); |
| | | // await this.getCurrentUserInfo(); |
| | | // } catch (error) {} |
| | | try { |
| | | this.setUserInfoAction(res); |
| | | this.setTokenAction(res); |
| | | await this.getCurrentUserInfo(); |
| | | } catch (error) {} |
| | | }, |
| | | |
| | | async loginVirtualSuccess(virtualUserId: string) { |
| | | try { |
| | | this.setVirtualUserId(virtualUserId); |
| | | } catch (error) {} |
| | | }, |
| | | |
| | | setVirtualUserId(virtualUserId: string) { |
| | | this.virtualUserId = virtualUserId; |
| | | setStorageVirtualUserId(virtualUserId); |
| | | }, |
| | | |
| | | async wxMiniAppUserLoginFromScan(wxIndentityRes: API.WxMiniAppIndentityInfo, uuid: string) { |
| | |
| | | this.userDetail = null; |
| | | removeUserInfo(); |
| | | removeUserDetail(); |
| | | removeStorageVirtualUserId(); |
| | | }, |
| | | |
| | | /** |