|
|
|
@ -27,13 +27,13 @@ service.interceptors.request.use((config: InternalAxiosRequestConfig) => { |
|
|
|
config.headers["user-token"] = userPinia.userToken; |
|
|
|
} |
|
|
|
|
|
|
|
console.error('<---------------请求拦截---------->') |
|
|
|
console.error('请求拦截----config------>', config.url) |
|
|
|
console.error('请求拦截----data------>', config.data) |
|
|
|
console.error('<---------------请求拦截---------->') |
|
|
|
// if (config.headers['content-type'] === 'application/json') {
|
|
|
|
// console.error('<---------------请求拦截---------->')
|
|
|
|
// console.error('请求拦截----config------>', config.url)
|
|
|
|
// console.error('请求拦截----data------>', config)
|
|
|
|
// console.error('<---------------请求拦截---------->')
|
|
|
|
// // if (config.headers['content-type'] === 'application/json') {
|
|
|
|
let { data, headers } = config |
|
|
|
//获取16位随机数
|
|
|
|
// //获取16位随机数
|
|
|
|
let randomString = generateRandomString(16) |
|
|
|
config.headers['Auth-key'] = randomString |
|
|
|
if (data) { |
|
|
|
@ -61,8 +61,8 @@ service.interceptors.response.use((response: AxiosResponse) => { |
|
|
|
let jsonData = sm4DecryptMethod(data.data, authKey) |
|
|
|
response.data.data = JSON.parse(jsonData) |
|
|
|
} |
|
|
|
console.error('行营结果----解密结构------>', response.config.url) |
|
|
|
console.error('行营结果----解密结构------>', response.data) |
|
|
|
// console.error('行营结果----解密结构------>', response.config.url)
|
|
|
|
// console.error('行营结果----解密结构------>', response.data)
|
|
|
|
// 对响应数据做点什么
|
|
|
|
const { code, msg } = response.data; |
|
|
|
//如果是以下状态直接放行
|
|
|
|
|