Conf(拦截器):设置超时时长为2分钟

This commit is contained in:
lifizer
2024-11-29 15:43:14 +08:00
parent e48762c783
commit 088f3ea370
+2 -1
View File
@@ -8,7 +8,7 @@ const http = new Request();
/* 设置全局配置 */
http.setConfig((config) => {
config.baseURL = VUE_APP_API_URL;
config.timeout = 2000;
config.timeout = 2 * 60 * 1000;
config.method = "POST";
config.responseType = "text";
config.header = {
@@ -34,6 +34,7 @@ http.interceptors.response.use(
return response;
},
(error) => {
console.log(error)
if (error.toString() == "Error: Network Error") {
console.log("————————");
console.log("发送请求失败", error);