|
|
|
@ -27,7 +27,7 @@ module.exports = { |
|
|
|
|
post: function (url, data, headerContentType, tentId, needAes, auth) { |
|
|
|
|
console.log(url, data, headerContentType, tentId, needAes, 'post请求参数'); |
|
|
|
|
|
|
|
|
|
if (needAes !== false) { |
|
|
|
|
if (needAes != false) { |
|
|
|
|
for (var key in data) { |
|
|
|
|
data[key] = aes.aesMinEncrypt(data[key]); |
|
|
|
|
} |
|
|
|
@ -36,10 +36,11 @@ module.exports = { |
|
|
|
|
headerContentType = headerContentType == "json" ? "application/json" : "application/x-www-form-urlencoded"; |
|
|
|
|
|
|
|
|
|
let headers = { |
|
|
|
|
"content-type": headerContentType |
|
|
|
|
"content-type": headerContentType, |
|
|
|
|
'Cache-Control': 'no-cache' |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
if (auth==true) { |
|
|
|
|
if (auth == true) { |
|
|
|
|
const tok = store.state.userInfo.accessToken || uni.getStorageSync('userInfo').accessToken; |
|
|
|
|
headers['Authorization'] = 'Bearer ' + tok; |
|
|
|
|
} |
|
|
|
@ -69,10 +70,18 @@ module.exports = { |
|
|
|
|
|
|
|
|
|
get: function (url, data, headerContentType, tentId, needAes, auth) { |
|
|
|
|
console.log(url, data, headerContentType, tentId, needAes, 'get请求参数'); |
|
|
|
|
|
|
|
|
|
if (needAes != false) { |
|
|
|
|
for (var key in data) { |
|
|
|
|
data[key] = aes.aesMinEncrypt(data[key]); // 进行加密
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
headerContentType = headerContentType ? headerContentType : "application/x-www-form-urlencoded"; |
|
|
|
|
|
|
|
|
|
let headers = { |
|
|
|
|
"content-type": headerContentType |
|
|
|
|
"content-type": headerContentType, |
|
|
|
|
'Cache-Control': 'no-cache' |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
if (auth == true) { |
|
|
|
|