登录传code

version/0412
fanfan 1 year ago
parent 4faa31831e
commit e7275b472a
  1. 1
      pages/login/components/mp-weixin-mobile.vue
  2. 13
      pages/login/index.vue

@ -59,7 +59,6 @@
} }
if (detail.errMsg == 'getPhoneNumber:ok') { if (detail.errMsg == 'getPhoneNumber:ok') {
app.isLoading = true app.isLoading = true
console.log(1111)
store.dispatch('LoginMpWxMobile', { store.dispatch('LoginMpWxMobile', {
code: app.code, code: app.code,
encryptedData: detail.encryptedData, encryptedData: detail.encryptedData,

@ -127,20 +127,27 @@
this.$toast('请输入验证码') this.$toast('请输入验证码')
return return
} }
const that = this; uni.login({
store.dispatch('Login', { provider: 'weixin',
success: function(res) {
const that = this;
store.dispatch('Login', {
smsCode: that.semCode, smsCode: that.semCode,
mobile: that.phoneNum, mobile: that.phoneNum,
refereeId: this.refereeId, refereeId: this.refereeId,
isParty: false, isParty: false,
partyData: {}, partyData: {},
refereeId: false ucode:res.code
// refereeId: false
}).then(res => { }).then(res => {
uni.setStorageSync('token', res.data.token) uni.setStorageSync('token', res.data.token)
that.$toast(res.message) that.$toast(res.message)
that.getUserInfo() that.getUserInfo()
setTimeout(() => that.onNavigateBack(1), 2000) setTimeout(() => that.onNavigateBack(1), 2000)
}) })
}
});
}, },
getUserInfo() { getUserInfo() {
UserApi.info() UserApi.info()

Loading…
Cancel
Save