build(projects): update deps and fix type error [升级依赖并修复类型问题]

This commit is contained in:
Soybean
2023-05-04 19:02:20 +08:00
parent 5a4f842774
commit 34f023c4b1
7 changed files with 239 additions and 187 deletions

View File

@ -1,5 +1,5 @@
import axios from 'axios';
import type { AxiosError, AxiosInstance, AxiosRequestConfig } from 'axios';
import type { AxiosResponse, AxiosError, AxiosInstance, AxiosRequestConfig } from 'axios';
import { REFRESH_TOKEN_CODE } from '@/config';
import {
localStg,
@ -59,7 +59,7 @@ export default class CustomAxiosInstance {
}
);
this.instance.interceptors.response.use(
async response => {
(async response => {
const { status } = response;
if (status === 200 || status < 300 || status === 304) {
const backend = response.data;
@ -82,7 +82,7 @@ export default class CustomAxiosInstance {
}
const error = handleResponseError(response);
return handleServiceResult(error, null);
},
}) as (response: AxiosResponse<any, any>) => Promise<AxiosResponse<any, any>>,
(axiosError: AxiosError) => {
const error = handleAxiosError(axiosError);
return handleServiceResult(error, null);