新增环境header
This commit is contained in:
parent
f8c31d6bb7
commit
756f567dba
|
@ -20,10 +20,13 @@ const requestWithoutCookie = promisify(wx.request);
|
||||||
// 考虑了Cookie的请求
|
// 考虑了Cookie的请求
|
||||||
const request = async function (options) {
|
const request = async function (options) {
|
||||||
let token = wx.getStorageSync('token');
|
let token = wx.getStorageSync('token');
|
||||||
|
const result = wx.getAccountInfoSync();
|
||||||
|
const { envVersion } = result.miniProgram;
|
||||||
options.header = {
|
options.header = {
|
||||||
Accept: 'application/json',
|
Accept: 'application/json',
|
||||||
'content-type': 'application/json; charset=utf-8',
|
'content-type': 'application/json; charset=utf-8',
|
||||||
"Authorization": token
|
"Authorization": token,
|
||||||
|
"env": envVersion
|
||||||
};
|
};
|
||||||
let response;
|
let response;
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user