yujialong 3 months ago
parent b10ac742a8
commit c517c9b03b
  1. 4
      pages/login/login.vue
  2. 2
      user/reg/reg.vue
  3. 2
      user/selectAccount/selectAccount.vue

@ -29,6 +29,7 @@
sessionKey: '', sessionKey: '',
openid: '', openid: '',
unionid: '', unionid: '',
unionid: '',
submiting: false, submiting: false,
} }
}, },
@ -51,8 +52,10 @@
const e = data.sessionKey const e = data.sessionKey
this.sessionKey = e.session_key this.sessionKey = e.session_key
this.openid = e.openid this.openid = e.openid
this.unionid = e.unionid || ''
uni.setStorageSync('sessionKey', e.session_key) uni.setStorageSync('sessionKey', e.session_key)
uni.setStorageSync('openid', e.openid) uni.setStorageSync('openid', e.openid)
uni.setStorageSync('unionid', e.unionid || '')
} catch (e) {} } catch (e) {}
} else { } else {
that.$util.errMsg('登录失败!') that.$util.errMsg('登录失败!')
@ -72,6 +75,7 @@
uni.setStorageSync('phone', phone) uni.setStorageSync('phone', phone)
const { data } = await studentBinding({ const { data } = await studentBinding({
openid: this.openid, openid: this.openid,
unionid: this.unionid,
phone, phone,
platformId: 1 platformId: 1
}) })

@ -19,6 +19,7 @@
data() { data() {
return { return {
openid: uni.getStorageSync('openid'), openid: uni.getStorageSync('openid'),
unionid: uni.getStorageSync('unionid'),
phone: uni.getStorageSync('phone'), phone: uni.getStorageSync('phone'),
form: { form: {
account: '', account: '',
@ -40,6 +41,7 @@
const { data } = await weChatToken({ const { data } = await weChatToken({
...form, ...form,
openid: this.openid, openid: this.openid,
unionid: this.unionid,
phone: this.phone, phone: this.phone,
platformId: 1, platformId: 1,
}) })

@ -26,6 +26,7 @@
return { return {
openid: '', openid: '',
phone: uni.getStorageSync('phone'), phone: uni.getStorageSync('phone'),
unionid: uni.getStorageSync('unionid'),
accounts: JSON.parse(uni.getStorageSync('accounts')), accounts: JSON.parse(uni.getStorageSync('accounts')),
} }
}, },
@ -40,6 +41,7 @@
const { data } = await weChatToken({ const { data } = await weChatToken({
id: item.id, id: item.id,
openid: this.openid, openid: this.openid,
unionid: this.unionid,
phone: item.phone, phone: item.phone,
platformId: 1, platformId: 1,
}) })

Loading…
Cancel
Save