Commit 0d8d01a1 by 高淑倩

tunnel-token

parent 42c2518b
...@@ -18,8 +18,8 @@ const prodCtx = 'https://crm-b.bigaka.com/api' // 发生产时解开此注释 ...@@ -18,8 +18,8 @@ const prodCtx = 'https://crm-b.bigaka.com/api' // 发生产时解开此注释
const devImgCtx = 'https://img3.bigaka.com/test' // 开发环境图片地址 const devImgCtx = 'https://img3.bigaka.com/test' // 开发环境图片地址
const testImgCtx = 'https://img3.bigaka.com/test' // 测试环境图片地址 const testImgCtx = 'https://img3.bigaka.com/test' // 测试环境图片地址
const preImgCtx = 'https://img3.bigaka.com/test' // 预生产环境图片地址 const preImgCtx = 'https://img3.bigaka.com/test' // 预生产环境图片地址
// const prodImgCtx = 'https://img3.bigaka.com' // 预生产环境图片地址 const prodImgCtx = 'https://img3.bigaka.com' // 预生产环境图片地址
const prodImgCtx = 'https://img3.bigaka.com/prd' // 预生产环境图片地址 // const prodImgCtx = 'https://img3.bigaka.com/prd' // 预生产环境图片地址
// const prodImgCtx = 'https://img3.bigaka.com' // 生产环境图片地址 // const prodImgCtx = 'https://img3.bigaka.com' // 生产环境图片地址
const config = { const config = {
......
...@@ -79,33 +79,83 @@ class Http { ...@@ -79,33 +79,83 @@ class Http {
.catch(this.fail) .catch(this.fail)
} }
// get (url, parmas) {
// return this.request({
// url,
// method: 'GET',
// header: {
// 'buyer-token': this.getToken()
// // 'buyer-token': '3e15b819c551713ae210adc525da028b'
// // 'seller-token': 'f80d09122733517ea4a0c2628c4eb0e9'
// },
// data: parmas
// })
// }
// post (url, parmas, channel) {
// return this.request({
// url,
// method: 'POST',
// header: {
// 'buyer-token': this.getToken()
// // 'buyer-token':'3e15b819c551713ae210adc525da028b'
// // 'seller-token': 'f80d09122733517ea4a0c2628c4eb0e9'
// },
// data: parmas,
// channel: channel
// })
// }
get (url, parmas) { get (url, parmas) {
let baseUserInfo = wx.getStorageSync('_baseUserInfo')
if(baseUserInfo){
return this.request({ return this.request({
url, url,
method: 'GET', method: 'GET',
header: { header: {
'buyer-token': this.getToken() 'buyer-token': this.getToken()
// 'buyer-token': '3e15b819c551713ae210adc525da028b'
// 'seller-token': 'f80d09122733517ea4a0c2628c4eb0e9'
}, },
data: parmas data: parmas
}) })
} else {
return this.request({
url,
method: 'GET',
header: {
// 'tunnel-token': 'aa8a1bfb7f6c5031d172d94b6574293ef954a6f2d4e16657da008e0cc15588feD', // 测试
'tunnel-token' : 'd6db651f8b9c7db4176465accfc1c913843fd9ad328cd5f4fe201d918072c9e8', // 生产
},
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',
header: { header: {
'buyer-token': this.getToken() 'buyer-token': this.getToken()
// 'buyer-token':'3e15b819c551713ae210adc525da028b'
// 'seller-token': 'f80d09122733517ea4a0c2628c4eb0e9'
}, },
data: parmas, data: parmas,
channel: channel channel: channel
}) })
} else {
return this.request({
url,
method: 'POST',
header: {
// 'tunnel-token': 'aa8a1bfb7f6c5031d172d94b6574293ef954a6f2d4e16657da008e0cc15588feD', // 测试
'tunnel-token' : 'd6db651f8b9c7db4176465accfc1c913843fd9ad328cd5f4fe201d918072c9e8', // 生产
},
data: parmas,
channel: channel
})
}
} }
checkStatus (resp) { checkStatus (resp) {
let status = resp.statusCode let status = resp.statusCode
if (status >= 200 && status < 300) { if (status >= 200 && status < 300) {
......
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