作者 王楠

连点

... ... @@ -138,7 +138,7 @@ Page({
let login = wx.getStorageSync('login')
let sq = wx.getStorageSync('sq')
console.log(token)
console.log(sq)
if (token == '' || sq == 2) {
// wx.showToast({
// title: '请登录后操作',
... ...
... ... @@ -58,7 +58,6 @@ Page({
encryptedData: res.encryptedData
})
if(that.data.iv){
wx.login({
success: function(r) {
that.setData({
... ... @@ -107,7 +106,9 @@ Page({
let that = this
wx.checkSession({
success(res) {
let u = a.interface.openid;
console.log(u)
let d = {
code: that.data.code,
iv: that.data.iv,
... ... @@ -115,7 +116,10 @@ Page({
}
a.post(u, d).then((r) => {
wx.hideLoading()
console.log(r)
if (r.code == 200) {
console.log(r)
wx.hideLoading()
wx.setStorageSync('token', r.token);
wx.setStorageSync('tel', r.tel);
... ... @@ -123,35 +127,18 @@ Page({
wx.setStorageSync('login', r.new_login);
wx.setStorageSync('gh_login', r.gh_login);
wx.setStorageSync('cb_login', r.cb_login);
wx.setStorageSync('sq', JSON.parse(r.sq1.msg).data)
wx.setStorageSync('gh_sq', JSON.parse(r.sq2.msg).data)
wx.setStorageSync('cb_sq', JSON.parse(r.sq3.msg).data)
wx.setStorageSync('sq', r.sq1)
wx.setStorageSync('gh_sq', r.sq2)
wx.setStorageSync('cb_sq', r.sq3)
wx.navigateBack({
delta: 0,
})
// wx.setStorageSync('tel', r.tel);
// wx.reLaunch({
// url: '/pages/index/index'
// })
// wx.reLaunch({
// url: '/pages/index/index'
// })
// if (r.new_login == 0) {
// // 未绑定手机号
// wx.redirectTo({
// url: '/pages/login/login'
// })
// } else if (r.new_login == 1) {
// wx.reLaunch({
// url: '/pages/index/index'
// })
// }
}
}).catch((er) => { })
}
,
},
fail(err) {
console.log(err)
wx.hideLoading();
that.getCodeFun()
}
... ...