@@ -477,8 +477,14 @@ Page({
|
||||
}
|
||||
},
|
||||
|
||||
goRegister() {
|
||||
wx.navigateTo({ url: '/pages/register/index' })
|
||||
async getWechatCode() {
|
||||
const result = await new Promise((resolve, reject) => wx.login({ success: resolve, fail: reject }))
|
||||
return result.code
|
||||
},
|
||||
|
||||
goRegister(wxCode) {
|
||||
const query = wxCode ? `?wxCode=${encodeURIComponent(wxCode)}` : ''
|
||||
wx.navigateTo({ url: `/pages/register/index${query}` })
|
||||
},
|
||||
|
||||
async wechatLogin() {
|
||||
@@ -489,7 +495,8 @@ Page({
|
||||
const result = await authApi.wechatAutoLogin(loginResult.code)
|
||||
if (result.status === 'NEED_MANUAL_LOGIN') {
|
||||
wx.showToast({ title: '新账号请先完成手机号注册和身份审核', icon: 'none', duration: 2500 })
|
||||
setTimeout(() => this.goRegister(), 900)
|
||||
const wxCode = await this.getWechatCode()
|
||||
setTimeout(() => this.goRegister(wxCode), 900)
|
||||
return
|
||||
}
|
||||
if (result.status !== 'SUCCESS' || !result.accessToken) {
|
||||
|
||||
Reference in New Issue
Block a user