mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-18 16:54:25 +08:00
code refactor
This commit is contained in:
@@ -0,0 +1,11 @@
|
|||||||
|
export interface ApiResponse<T> {
|
||||||
|
readonly success: boolean;
|
||||||
|
readonly result: T;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ErrorResponse {
|
||||||
|
readonly success: boolean;
|
||||||
|
readonly errorCode: number;
|
||||||
|
readonly errorMessage: string;
|
||||||
|
readonly path: string;
|
||||||
|
}
|
||||||
+2
-5
@@ -1,5 +1,7 @@
|
|||||||
import axios, { type AxiosRequestConfig, type AxiosRequestHeaders, type AxiosResponse } from 'axios';
|
import axios, { type AxiosRequestConfig, type AxiosRequestHeaders, type AxiosResponse } from 'axios';
|
||||||
|
|
||||||
|
import type { ApiResponse } from '@/core/api.ts';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
BASE_API_URL_PATH,
|
BASE_API_URL_PATH,
|
||||||
BASE_QRCODE_PATH,
|
BASE_QRCODE_PATH,
|
||||||
@@ -135,11 +137,6 @@ interface ApiRequestConfig extends AxiosRequestConfig {
|
|||||||
timeout?: number;
|
timeout?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ApiResponse<T> {
|
|
||||||
readonly success: boolean;
|
|
||||||
readonly result: T;
|
|
||||||
}
|
|
||||||
|
|
||||||
type ApiResponsePromise<T> = Promise<AxiosResponse<ApiResponse<T>>>;
|
type ApiResponsePromise<T> = Promise<AxiosResponse<ApiResponse<T>>>;
|
||||||
|
|
||||||
let needBlockRequest = false;
|
let needBlockRequest = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user