update naming style
This commit is contained in:
parent
20797914db
commit
312c9ebaec
|
|
@ -52,19 +52,27 @@ service.interceptors.request.use(config => {
|
|||
config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义 token
|
||||
}
|
||||
|
||||
// 处理 GET 请求
|
||||
// // 处理 GET 请求
|
||||
// if (config.method === 'get' && config.params) {
|
||||
// let params = tansParams(config.params).slice(0, -1)
|
||||
// // 数据完整性校验
|
||||
// if (CONFIG.dataSettings.integrityCheck && checkIntegrity) {
|
||||
// config.headers['Params-Hash'] = hashWithSM3AndSalt(params)
|
||||
// }
|
||||
// // 加密参数
|
||||
// if (CONFIG.dataSettings.encryptRequest && encryptRequest) {
|
||||
// params = encryptCBC(params)
|
||||
// }
|
||||
// config.url = `${config.url}?${params}`
|
||||
// config.params = {}
|
||||
// }
|
||||
|
||||
// get请求映射params参数
|
||||
if (config.method === 'get' && config.params) {
|
||||
let params = tansParams(config.params).slice(0, -1)
|
||||
// 数据完整性校验
|
||||
if (CONFIG.dataSettings.integrityCheck && checkIntegrity) {
|
||||
config.headers['Params-Hash'] = hashWithSM3AndSalt(params)
|
||||
}
|
||||
// 加密参数
|
||||
if (CONFIG.dataSettings.encryptRequest && encryptRequest) {
|
||||
params = encryptCBC(params)
|
||||
}
|
||||
config.url = `${config.url}?${params}`
|
||||
config.params = {}
|
||||
let url = config.url + '?' + tansParams(config.params);
|
||||
url = url.slice(0, -1);
|
||||
config.params = {};
|
||||
config.url = url;
|
||||
}
|
||||
|
||||
if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue