Browse Source

优化

master
suyanyan 1 month ago
parent
commit
f4ba697433
2 changed files with 6 additions and 4 deletions
  1. +3
    -1
      SafeCampus.WEB/src/api/modules/sysconfig/ability.ts
  2. +3
    -3
      SafeCampus.WEB/src/api/request/instance.ts

+ 3
- 1
SafeCampus.WEB/src/api/modules/sysconfig/ability.ts View File

@@ -28,7 +28,9 @@ const abilityApi = {
}, },
/* 预警分析报告导出 */ /* 预警分析报告导出 */
reportExport(params: any) { reportExport(params: any) {
return http1.download("reportExport", params);
return http1.download("reportExport", params, {
showHeader: true
});
} }
}; };




+ 3
- 3
SafeCampus.WEB/src/api/request/instance.ts View File

@@ -112,7 +112,7 @@ export default class RequestHttp {
(response: AxiosResponse) => { (response: AxiosResponse) => {
// 检查并存储授权信息 // 检查并存储授权信息
this.checkAndStoreAuthentication(response); this.checkAndStoreAuthentication(response);
const { data, config } = response;
const { data, config }: any = response;
const userStore = useUserStore(); const userStore = useUserStore();
axiosCanceler.removePending(config); axiosCanceler.removePending(config);
tryHideFullScreenLoading(); tryHideFullScreenLoading();
@@ -141,8 +141,8 @@ export default class RequestHttp {
}); });
} }
// 成功请求(在页面上除非特殊情况,否则不用处理失败逻辑) // 成功请求(在页面上除非特殊情况,否则不用处理失败逻辑)
if (`${config.baseURL}${config.url}` == "/api/violation/analysis/reportExport") {
return response;
if (config.showHeader) {
return response; //平时用在打印、导出、下载的时候使用
} else { } else {
return data; return data;
} }


Loading…
Cancel
Save