|
|
@@ -22,6 +22,7 @@ import { checkStatus } from "../helper/checkStatus"; |
|
|
|
import { useUserStore } from "@/stores/modules"; |
|
|
|
import { AxiosCanceler } from "../helper/axiosCancel"; |
|
|
|
import router from "@/routers"; |
|
|
|
import { i } from "vite/dist/node/types.d-jgA8ss1A"; |
|
|
|
|
|
|
|
// 自定义 AxiosRequestConfig 接口,增加 noLoading 属性 |
|
|
|
export interface CustomAxiosRequestConfig extends InternalAxiosRequestConfig { |
|
|
@@ -109,6 +110,8 @@ export default class RequestHttp { |
|
|
|
*/ |
|
|
|
this.service.interceptors.response.use( |
|
|
|
(response: AxiosResponse) => { |
|
|
|
console.log(response, "........"); |
|
|
|
|
|
|
|
// 检查并存储授权信息 |
|
|
|
this.checkAndStoreAuthentication(response); |
|
|
|
const { data, config } = response; |
|
|
@@ -140,7 +143,11 @@ export default class RequestHttp { |
|
|
|
}); |
|
|
|
} |
|
|
|
// 成功请求(在页面上除非特殊情况,否则不用处理失败逻辑) |
|
|
|
return data; |
|
|
|
if (`${config.baseURL}${config.url}` == "/api/violation/analysis/reportExport") { |
|
|
|
return response; |
|
|
|
} else { |
|
|
|
return data; |
|
|
|
} |
|
|
|
}, |
|
|
|
async (error: AxiosError) => { |
|
|
|
const { response } = error; |
|
|
|