账单查询
This commit is contained in:
@@ -21,24 +21,11 @@ Page({
|
||||
wx.login({
|
||||
success (res) {
|
||||
if (res.code) {
|
||||
let param = {
|
||||
appid:'wxb1f499f0a173865b',
|
||||
secret:'833eefaf9206337d6c2d643f94baef7b',
|
||||
js_code: res.code,
|
||||
grant_type: 'authorization_code'
|
||||
};
|
||||
//发起网络请求
|
||||
wx.request({
|
||||
url: 'https://api.weixin.qq.com/sns/jscode2session',
|
||||
data: param,
|
||||
success: function(x) {
|
||||
app.$api.loginAccount({"openId":x.data.openid}).then(t=>{
|
||||
wx.setStorageSync("userId",t.data)
|
||||
that.setData({
|
||||
noLogin : false
|
||||
})
|
||||
})
|
||||
}
|
||||
app.$api.loginAccount({"wxCode":res.code}).then(t=>{
|
||||
wx.setStorageSync("userId",t.data)
|
||||
that.setData({
|
||||
noLogin : false
|
||||
})
|
||||
})
|
||||
} else {
|
||||
console.log('登录失败!' + res.errMsg)
|
||||
|
||||
Reference in New Issue
Block a user