Parcourir la source

fix(axios): 请求异常时,无法正确执行 catch

zuihou il y a 3 ans
Parent
commit
419b7aea07
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      src/utils/http/axios/Axios.ts

+ 1 - 1
src/utils/http/axios/Axios.ts

@@ -113,7 +113,7 @@ export class VAxios {
       isFunction(responseInterceptorsCatch) &&
       this.axiosInstance.interceptors.response.use(undefined, (error) => {
         // @ts-ignore
-        responseInterceptorsCatch(this.axiosInstance, error);
+        return responseInterceptorsCatch(this.axiosInstance, error);
       });
   }