mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-10 17:26:38 +08:00
cap 与系统信息
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
import axios, { AxiosError, AxiosResponse, CancelTokenSource, InternalAxiosRequestConfig } from 'axios';
|
||||
import { toast } from 'sonner';
|
||||
import { apiConfig } from './config';
|
||||
import axios, {AxiosError, AxiosResponse, CancelTokenSource, InternalAxiosRequestConfig} from 'axios';
|
||||
import {toast} from 'sonner';
|
||||
import {apiConfig} from './config';
|
||||
import {
|
||||
ApiErrorBase,
|
||||
NetworkError,
|
||||
TimeoutError,
|
||||
ForbiddenError,
|
||||
NetworkError,
|
||||
NotFoundError,
|
||||
ServerError,
|
||||
TimeoutError,
|
||||
ValidationError,
|
||||
} from './errors';
|
||||
import { ApiError, ApiResponse } from './types';
|
||||
import {ApiError, ApiResponse} from './types';
|
||||
|
||||
/**
|
||||
* API 客户端实例
|
||||
@@ -102,6 +102,11 @@ apiClient.interceptors.response.use(
|
||||
cancelTokens.delete(requestKey);
|
||||
pendingRequests.delete(requestKey);
|
||||
|
||||
const resData = response.data as any;
|
||||
if (resData && resData.error_msg) {
|
||||
return Promise.reject(new ApiErrorBase(resData.error_msg));
|
||||
}
|
||||
|
||||
return response;
|
||||
},
|
||||
(error: AxiosError<ApiError>) => {
|
||||
|
||||
Reference in New Issue
Block a user