| | |
| | | setMatchMakingIdentity, |
| | | } from '@/utils/storage/auth'; |
| | | import * as accountServices from '@12333/services/api/Account'; |
| | | import * as userServices from '@12333/services/api/User'; |
| | | // import * as userServices from '@12333/services/api/User'; |
| | | import Taro, { useRouter } from '@tarojs/taro'; |
| | | import { ButtonProps } from '@tarojs/components'; |
| | | import { debounce } from 'lodash'; |
| | |
| | | sessionKey: wxMiniAppUserLoginRes.sessionKey, |
| | | encryptedData: detail.encryptedData, |
| | | iv: detail.iv, |
| | | wxMiniApp: WxMiniAppEnum.人单合一, |
| | | wxMiniApp: WxMiniAppEnum.C端小程序, |
| | | }; |
| | | res = await accountServices.wxMiniAppPhoneAuthLogin(params); |
| | | this.loginSuccess(res); |
| | |
| | | try { |
| | | this.setUserInfoAction(res); |
| | | this.setTokenAction(res); |
| | | await this.getCurrentUserInfo(); |
| | | // await this.getCurrentUserInfo(); |
| | | } catch (error) {} |
| | | }, |
| | | |
| | |
| | | sessionKey: wxIndentityRes.sessionKey, |
| | | encryptedData: detail.encryptedData, |
| | | iv: detail.iv, |
| | | wxMiniApp: WxMiniAppEnum.人单合一, |
| | | wxMiniApp: WxMiniAppEnum.C端小程序, |
| | | }); |
| | | this.loginSuccess(res); |
| | | return res; |
| | | } 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 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) {} |
| | | // }, |
| | | |
| | | setTokenAction(tokenInfo: API.IdentityModelTokenCacheItem) { |
| | | this.token = tokenInfo?.accessToken; |