diff --git a/app/js/utils/request.ts b/app/js/utils/request.ts index 0b2be3a4..451ffcc8 100644 --- a/app/js/utils/request.ts +++ b/app/js/utils/request.ts @@ -9,14 +9,6 @@ export type Body = Query | BodyInit | null; export type Query = Record; -export interface Options extends Omit { - body?: Body; - query?: Query; - baseURL?: string; - onUnauthorized?: () => void; - onMessage?: (message: string) => void; -} - export interface RequestResult { payload: R; msg: string; @@ -28,6 +20,14 @@ export interface RequestError extends Error { response?: R; } +export interface Options extends Omit { + body?: Body; + query?: Query; + baseURL?: string; + onUnauthorized?: () => void; + onMessage?: (message: string) => void; +} + const STATUS_TEXT: Record = { 200: '操作成功', 401: '未经授权',