refactor(project): @vben/vite-connect is reconfigured to support synchronization
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
# @vben-core/forward
|
||||
|
||||
该目录内的包,可直接被app所引用
|
||||
该目录内的包,可直接被app所引用,其是项目基础功能的一层抽象。允许轻微的副作用耦合,如`locales`的集成。
|
||||
|
||||
## 注意事项
|
||||
|
||||
- `forward` 内的包不允许相互引用,有相互引用的情况请考虑是否放到`packages/effects`下
|
||||
|
@@ -4,6 +4,8 @@ import {
|
||||
type InternalAxiosRequestConfig,
|
||||
} from 'axios';
|
||||
|
||||
const errorHandler = (res: Error) => Promise.reject(res);
|
||||
|
||||
class InterceptorManager {
|
||||
private axiosInstance: AxiosInstance;
|
||||
|
||||
@@ -19,7 +21,7 @@ class InterceptorManager {
|
||||
) {
|
||||
this.axiosInstance.interceptors.request.use(
|
||||
fulfilled,
|
||||
rejected || ((res) => Promise.reject(res)),
|
||||
rejected || errorHandler,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -31,7 +33,7 @@ class InterceptorManager {
|
||||
) {
|
||||
this.axiosInstance.interceptors.response.use(
|
||||
fulfilled,
|
||||
rejected || ((res) => Promise.reject(res)),
|
||||
rejected || errorHandler,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user