安全性问题处理:代码版本整理 修复版本1 --提交人:阳华祥

This commit is contained in:
yang.huaxiang
2020-10-27 11:05:01 +08:00
parent b913e73c47
commit 43117c24a9
8 changed files with 138 additions and 70 deletions

View File

@@ -127,7 +127,7 @@ service.interceptors.request.use(
/**
* 请求拦截处理(待添加 判断走统一网关处理)
*/
if(config.url && config.method == 'post' && /api\/$/.test(config.url.split(configApp.API_VERSION)[0])){
if(config.url && /api\/$/.test(config.url.split(configApp.API_VERSION)[0])){
if(!config.data || config.data == null){
config.data = {}
}
@@ -158,7 +158,7 @@ service.interceptors.response.use(
console.log(response)
console.log('----------------')
let res = response.data
if(response.config.url && response.config.method == 'post' && /api\/$/.test(response.config.url.split(configApp.API_VERSION)[0])){
if(response.config.url && response.headers['content-type'].match(/application\/json/) && /api\/$/.test(response.config.url.split(configApp.API_VERSION)[0])){
if(res.response){// 正常情況返回必有response 节点
console.log("[调用请求解密服务][请求地址:"+response.config.url+"][解密前报文:]",JSON.stringify(res.response))
res = JSON.parse(AESTools.AESDecrypt(res.response,configApp.REQ_PWD))