登录和绑定微信的完善,我的页面需要登录验证
This commit is contained in:
@@ -13,9 +13,9 @@ Page({
|
||||
form: {
|
||||
currdatetime: '',
|
||||
requestCodeSuccess: true,
|
||||
randCodeImage: '', // 验证码
|
||||
rsaPublicKey: '', // 公钥
|
||||
randCodeImage: '' // 验证码
|
||||
},
|
||||
rsaPublicKey: '', // 公钥
|
||||
flag: false
|
||||
},
|
||||
|
||||
@@ -108,8 +108,11 @@ Page({
|
||||
if(this.data.flag){
|
||||
UserApi.passWordLogin(params).then(res => {
|
||||
if(res.success){
|
||||
// 微信绑定
|
||||
this.wxBind()
|
||||
// 如果绑定过微信就不再进行绑定
|
||||
if(!res.result.userInfo.openId){
|
||||
// 绑定微信
|
||||
this.wxBindPhone()
|
||||
}
|
||||
// 存token和userInfo
|
||||
wx.setStorage({
|
||||
key: 'X-Access-Token',
|
||||
@@ -137,7 +140,8 @@ Page({
|
||||
},
|
||||
|
||||
// 绑定微信
|
||||
wxBind(){
|
||||
wxBindPhone(){
|
||||
const that = this
|
||||
// 获取openid进行手机号和微信的绑定
|
||||
wxBind((res)=>{
|
||||
let params = {
|
||||
|
||||
Reference in New Issue
Block a user