Browse Source

feat(config): 添加全局请求超时配置并优化代码格式

- 在 globalConfig 中添加 axiosRequestDef函数,设置请求超时时间为10 分钟
- 优化代码格式,调整缩进和空格
master
lizw-2015 5 months ago
parent
commit
35a1e12792
  1. 2
      src/config.ts

2
src/config.ts

@ -8,7 +8,7 @@ import ErrorDialog from "@/components/ErrorDialog.vue";
function globalConfig() { function globalConfig() {
window.globalConfig.axiosRequestDef = () => ({ window.globalConfig.axiosRequestDef = () => ({
timeout: 1000 * 60 * 10, timeout: 1000 * 60 * 10,
}) });
window.globalConfig.customAxios = axiosInstance => { window.globalConfig.customAxios = axiosInstance => {
// 全局请求拦截 // 全局请求拦截
axiosInstance.interceptors.request.clear(); axiosInstance.interceptors.request.clear();

Loading…
Cancel
Save