Commit ad3cf858 by daqian

header_tunnel-token

parent cc4e1905
...@@ -79,7 +79,14 @@ class Http { ...@@ -79,7 +79,14 @@ class Http {
.catch(this.fail) .catch(this.fail)
} }
// header: {
// 'tunnel-token' : 'aa8a1bfb7f6c5031d172d94b6574293ef954a6f2d4e16657da008e0cc15588feD'
// },
get (url, parmas) { get (url, parmas) {
let baseUserInfo = wx.getStorageSync('_baseUserInfo')
console.log('baseUserInfo', baseUserInfo ? 'buyer-token' : 'tunnel-token')
if(baseUserInfo){
return this.request({ return this.request({
url, url,
method: 'GET', method: 'GET',
...@@ -89,9 +96,24 @@ class Http { ...@@ -89,9 +96,24 @@ class Http {
}, },
data: parmas data: parmas
}) })
} else {
return this.request({
url,
method: 'GET',
header: {
'tunnel-token': this.getToken(),
'TENTACLE_CONTENT': this.getTentacle()
},
data: parmas
})
}
} }
post (url, parmas, channel) { post (url, parmas, channel) {
let baseUserInfo = wx.getStorageSync('_baseUserInfo')
if(baseUserInfo){
return this.request({ return this.request({
url, url,
method: 'POST', method: 'POST',
...@@ -102,6 +124,18 @@ class Http { ...@@ -102,6 +124,18 @@ class Http {
data: parmas, data: parmas,
channel: channel channel: channel
}) })
} else {
return this.request({
url,
method: 'POST',
header: {
'tunnel-token': this.getToken(),
'TENTACLE_CONTENT': this.getTentacle()
},
data: parmas,
channel: channel
})
}
} }
checkStatus (resp) { checkStatus (resp) {
......
...@@ -308,8 +308,9 @@ function _getUserInfo(ev) { ...@@ -308,8 +308,9 @@ function _getUserInfo(ev) {
setUserInfo() // 判断有无开卡 setUserInfo() // 判断有无开卡
}).catch(err => { }).catch(err => {
if (err) { if (err) {
console.log('err', err)
wx.showToast({ wx.showToast({
title: `会员系统异常请稍后重试!`, title: `您已拒绝授权!`,
icon: 'none' icon: 'none'
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment