|
@@ -58,7 +58,6 @@ Page({ |
|
@@ -58,7 +58,6 @@ Page({ |
58
|
encryptedData: res.encryptedData
|
58
|
encryptedData: res.encryptedData
|
59
|
})
|
59
|
})
|
60
|
if(that.data.iv){
|
60
|
if(that.data.iv){
|
61
|
-
|
|
|
62
|
wx.login({
|
61
|
wx.login({
|
63
|
success: function(r) {
|
62
|
success: function(r) {
|
64
|
that.setData({
|
63
|
that.setData({
|
|
@@ -107,7 +106,9 @@ Page({ |
|
@@ -107,7 +106,9 @@ Page({ |
107
|
let that = this
|
106
|
let that = this
|
108
|
wx.checkSession({
|
107
|
wx.checkSession({
|
109
|
success(res) {
|
108
|
success(res) {
|
|
|
109
|
+
|
110
|
let u = a.interface.openid;
|
110
|
let u = a.interface.openid;
|
|
|
111
|
+ console.log(u)
|
111
|
let d = {
|
112
|
let d = {
|
112
|
code: that.data.code,
|
113
|
code: that.data.code,
|
113
|
iv: that.data.iv,
|
114
|
iv: that.data.iv,
|
|
@@ -115,7 +116,10 @@ Page({ |
|
@@ -115,7 +116,10 @@ Page({ |
115
|
}
|
116
|
}
|
116
|
a.post(u, d).then((r) => {
|
117
|
a.post(u, d).then((r) => {
|
117
|
wx.hideLoading()
|
118
|
wx.hideLoading()
|
|
|
119
|
+ console.log(r)
|
118
|
if (r.code == 200) {
|
120
|
if (r.code == 200) {
|
|
|
121
|
+ console.log(r)
|
|
|
122
|
+ wx.hideLoading()
|
119
|
wx.setStorageSync('token', r.token);
|
123
|
wx.setStorageSync('token', r.token);
|
120
|
wx.setStorageSync('tel', r.tel);
|
124
|
wx.setStorageSync('tel', r.tel);
|
121
|
|
125
|
|
|
@@ -123,35 +127,18 @@ Page({ |
|
@@ -123,35 +127,18 @@ Page({ |
123
|
wx.setStorageSync('login', r.new_login);
|
127
|
wx.setStorageSync('login', r.new_login);
|
124
|
wx.setStorageSync('gh_login', r.gh_login);
|
128
|
wx.setStorageSync('gh_login', r.gh_login);
|
125
|
wx.setStorageSync('cb_login', r.cb_login);
|
129
|
wx.setStorageSync('cb_login', r.cb_login);
|
126
|
- wx.setStorageSync('sq', JSON.parse(r.sq1.msg).data)
|
|
|
127
|
- wx.setStorageSync('gh_sq', JSON.parse(r.sq2.msg).data)
|
|
|
128
|
- wx.setStorageSync('cb_sq', JSON.parse(r.sq3.msg).data)
|
|
|
129
|
- wx.navigateBack({
|
130
|
+ wx.setStorageSync('sq', r.sq1)
|
|
|
131
|
+ wx.setStorageSync('gh_sq', r.sq2)
|
|
|
132
|
+ wx.setStorageSync('cb_sq', r.sq3)
|
|
|
133
|
+ wx.navigateBack({
|
130
|
delta: 0,
|
134
|
delta: 0,
|
131
|
})
|
135
|
})
|
132
|
- // wx.setStorageSync('tel', r.tel);
|
|
|
133
|
- // wx.reLaunch({
|
|
|
134
|
- // url: '/pages/index/index'
|
|
|
135
|
- // })
|
|
|
136
|
- // wx.reLaunch({
|
|
|
137
|
- // url: '/pages/index/index'
|
|
|
138
|
- // })
|
|
|
139
|
-
|
|
|
140
|
- // if (r.new_login == 0) {
|
|
|
141
|
- // // 未绑定手机号
|
|
|
142
|
- // wx.redirectTo({
|
|
|
143
|
- // url: '/pages/login/login'
|
|
|
144
|
- // })
|
|
|
145
|
- // } else if (r.new_login == 1) {
|
|
|
146
|
- // wx.reLaunch({
|
|
|
147
|
- // url: '/pages/index/index'
|
|
|
148
|
- // })
|
|
|
149
|
- // }
|
136
|
+
|
150
|
}
|
137
|
}
|
151
|
}).catch((er) => { })
|
138
|
}).catch((er) => { })
|
152
|
- }
|
|
|
153
|
- ,
|
139
|
+ },
|
154
|
fail(err) {
|
140
|
fail(err) {
|
|
|
141
|
+ console.log(err)
|
155
|
wx.hideLoading();
|
142
|
wx.hideLoading();
|
156
|
that.getCodeFun()
|
143
|
that.getCodeFun()
|
157
|
}
|
144
|
}
|