|
@@ -46,10 +46,16 @@ http.interceptors.request.use((config) => {
|
|
|
"Authorization": "Basic c2FiZXI6c2FiZXJfc2VjcmV0",
|
|
"Authorization": "Basic c2FiZXI6c2FiZXJfc2VjcmV0",
|
|
|
"Blade-Auth": getTokenStorage()
|
|
"Blade-Auth": getTokenStorage()
|
|
|
}
|
|
}
|
|
|
- if (setting.enabledCrypto && config.method == 'POST' && config.data && crypto.isNotInWhiteList(config.url) ) {
|
|
|
|
|
- let encrypt = crypto.encrypt(JSON.stringify(config.data))
|
|
|
|
|
- config.data = encrypt
|
|
|
|
|
|
|
+ // 1:开启加密
|
|
|
|
|
+ // 2:post请求
|
|
|
|
|
+ // 3:请求体不为空
|
|
|
|
|
+ // 4: url不在白名单内
|
|
|
|
|
+ if (Global.enabledCrypto && config.method == 'POST' && config.data && crypto.isNotInWhiteList(config.url)) {
|
|
|
|
|
+ //报文加密
|
|
|
|
|
+ let encrypt= crypto.encrypt(JSON.stringify(config.data))
|
|
|
|
|
+ config.data=encrypt
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
return config
|
|
return config
|
|
|
}, (config) => {
|
|
}, (config) => {
|
|
|
return Promise.reject(config)
|
|
return Promise.reject(config)
|