修改base,增加资源来源地址,修复资源错误加载的问题
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
import axios, { AxiosError, type AxiosInstance, type AxiosRequestConfig } from "axios";
|
||||
import axios, {
|
||||
AxiosError,
|
||||
type AxiosInstance,
|
||||
type AxiosRequestConfig,
|
||||
AxiosResponse,
|
||||
InternalAxiosRequestConfig
|
||||
} from "axios";
|
||||
import { UrlCheckUtils } from '../utils/index'
|
||||
|
||||
|
||||
@@ -52,9 +58,9 @@ class AxiosInfra {
|
||||
* 响应拦截器
|
||||
* @constructor
|
||||
*/
|
||||
public async ResponseInterceptor(): Promise<any> {
|
||||
public async ResponseInterceptor(): Promise<void> {
|
||||
this.instance.interceptors.response.use(
|
||||
(response: any) => {
|
||||
(response: AxiosResponse) => {
|
||||
return response.data.result;
|
||||
},
|
||||
(error: AxiosError) => {
|
||||
@@ -79,8 +85,8 @@ class AxiosInfra {
|
||||
* 添加请求拦截器
|
||||
* @constructor
|
||||
*/
|
||||
public async RequestInterceptor(): Promise<any> {
|
||||
this.instance.interceptors.request.use((config: any) => {
|
||||
public async RequestInterceptor(): Promise<void> {
|
||||
this.instance.interceptors.request.use((config: InternalAxiosRequestConfig) => {
|
||||
return config
|
||||
}, function (error: AxiosError) {
|
||||
return Promise.reject(error)
|
||||
|
||||
Reference in New Issue
Block a user