Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
7
7-Eleven
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
高淑倩
7-Eleven
Commits
0d8d01a1
Commit
0d8d01a1
authored
Oct 10, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tunnel-token
parent
42c2518b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
23 deletions
+73
-23
index.js
src/config/index.js
+2
-2
Http.js
src/utils/Http.js
+71
-21
No files found.
src/config/index.js
View file @
0d8d01a1
...
...
@@ -18,8 +18,8 @@ const prodCtx = 'https://crm-b.bigaka.com/api' // 发生产时解开此注释
const
devImgCtx
=
'https://img3.bigaka.com/test'
// 开发环境图片地址
const
testImgCtx
=
'https://img3.bigaka.com/test'
// 测试环境图片地址
const
preImgCtx
=
'https://img3.bigaka.com/test'
// 预生产环境图片地址
//
const prodImgCtx = 'https://img3.bigaka.com' // 预生产环境图片地址
const
prodImgCtx
=
'https://img3.bigaka.com/prd'
// 预生产环境图片地址
const
prodImgCtx
=
'https://img3.bigaka.com'
// 预生产环境图片地址
//
const prodImgCtx = 'https://img3.bigaka.com/prd' // 预生产环境图片地址
// const prodImgCtx = 'https://img3.bigaka.com' // 生产环境图片地址
const
config
=
{
...
...
src/utils/Http.js
View file @
0d8d01a1
...
...
@@ -79,32 +79,82 @@ class Http {
.
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
)
{
return
this
.
request
({
url
,
method
:
'GET'
,
header
:
{
'buyer-token'
:
this
.
getToken
()
// 'buyer-token': '3e15b819c551713ae210adc525da028b'
// 'seller-token': 'f80d09122733517ea4a0c2628c4eb0e9'
},
data
:
parmas
})
let
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
if
(
baseUserInfo
){
return
this
.
request
({
url
,
method
:
'GET'
,
header
:
{
'buyer-token'
:
this
.
getToken
()
},
data
:
parmas
})
}
else
{
return
this
.
request
({
url
,
method
:
'GET'
,
header
:
{
// 'tunnel-token': 'aa8a1bfb7f6c5031d172d94b6574293ef954a6f2d4e16657da008e0cc15588feD', // 测试
'tunnel-token'
:
'd6db651f8b9c7db4176465accfc1c913843fd9ad328cd5f4fe201d918072c9e8'
,
// 生产
},
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
})
let
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
if
(
baseUserInfo
){
return
this
.
request
({
url
,
method
:
'POST'
,
header
:
{
'buyer-token'
:
this
.
getToken
()
},
data
:
parmas
,
channel
:
channel
})
}
else
{
return
this
.
request
({
url
,
method
:
'POST'
,
header
:
{
// 'tunnel-token': 'aa8a1bfb7f6c5031d172d94b6574293ef954a6f2d4e16657da008e0cc15588feD', // 测试
'tunnel-token'
:
'd6db651f8b9c7db4176465accfc1c913843fd9ad328cd5f4fe201d918072c9e8'
,
// 生产
},
data
:
parmas
,
channel
:
channel
})
}
}
checkStatus
(
resp
)
{
let
status
=
resp
.
statusCode
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment