| | |
| | | ) { |
| | | try { |
| | | let res: API.LoginCommandCallback = wxMiniAppUserLoginRes; |
| | | if (!wxMiniAppUserLoginRes.isBindPhoneNumber) { |
| | | if (!wxMiniAppUserLoginRes?.isBindPhoneNumber) { |
| | | let bindRes = await authServices.bindWxmpUserInfo({ |
| | | encryptedData: detail.encryptedData, |
| | | iv: detail.iv, |
| | | sessionKey: wxMiniAppUserLoginRes.sessionKey, |
| | | accessToken: wxMiniAppUserLoginRes.accessToken, |
| | | }); |
| | | res.accessToken = bindRes.accessToken; |
| | | this.loginSuccess(res); |
| | | } |
| | | this.loginSuccess(res); |
| | | return res; |
| | | } catch (error) { |
| | | console.log('error3: ', error); |
| | |
| | | try { |
| | | this.setUserInfoAction(res); |
| | | this.setTokenAction(res); |
| | | console.log('22', 22); |
| | | myClient.refetchQueries(); |
| | | // await this.getCurrentUserInfo(); |
| | | } catch (error) {} |
| | | }, |
| | |
| | | */ |
| | | logout() { |
| | | this.resetState(); |
| | | myClient.removeQueries(); |
| | | // myClient.removeQueries(); |
| | | goAuthorization(); |
| | | }, |
| | | |