fix: 兼容后端 code 类型不统一问题
This commit is contained in:
@@ -47,7 +47,7 @@ export interface BannerActiveParams {
|
||||
}
|
||||
|
||||
export interface ApiResult<T> {
|
||||
code: string;
|
||||
code: number | string;
|
||||
msg: string;
|
||||
data: T;
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ export interface PageData<T> {
|
||||
/** 统一响应包裹 */
|
||||
export interface ApiResult<T> {
|
||||
/** 编码:200表示成功,其他值表示失败 */
|
||||
code: string;
|
||||
code: number | string;
|
||||
/** 消息内容 */
|
||||
msg: string;
|
||||
/** 响应数据 */
|
||||
|
||||
@@ -5,7 +5,7 @@ export type { LoginResult } from './types';
|
||||
|
||||
export const login = (params: { phone: string; password: string }) => {
|
||||
return post(`/op/login`, params) as Promise<{
|
||||
code: string;
|
||||
code: number | string;
|
||||
msg: string;
|
||||
data: LoginResult;
|
||||
}>;
|
||||
|
||||
@@ -57,7 +57,7 @@ export interface PageData<T> {
|
||||
}
|
||||
|
||||
export interface ApiResult<T> {
|
||||
code: string;
|
||||
code: number | string;
|
||||
msg: string;
|
||||
data: T;
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ export interface PageData<T> {
|
||||
|
||||
/** 统一响应包裹 */
|
||||
export interface ApiResult<T> {
|
||||
code: string;
|
||||
code: number | string;
|
||||
msg: string;
|
||||
data: T;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ export interface PaymentFlowPageData {
|
||||
}
|
||||
|
||||
export interface ApiResult<T> {
|
||||
code: string;
|
||||
code: number | string;
|
||||
msg: string;
|
||||
data: T;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ export interface ReportQueryParams {
|
||||
}
|
||||
|
||||
export interface ApiResult<T> {
|
||||
code: string;
|
||||
code: number | string;
|
||||
msg: string;
|
||||
data: T;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ export interface PageData<T> {
|
||||
list: T[];
|
||||
}
|
||||
export interface ApiResult<T> {
|
||||
code: string;
|
||||
code: number | string;
|
||||
msg: string;
|
||||
data: T;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ export interface PageData<T> {
|
||||
list: T[];
|
||||
}
|
||||
export interface ApiResult<T> {
|
||||
code: string;
|
||||
code: number | string;
|
||||
msg: string;
|
||||
data: T;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ export interface PageData<T> {
|
||||
list: T[];
|
||||
}
|
||||
export interface ApiResult<T> {
|
||||
code: string;
|
||||
code: number | string;
|
||||
msg: string;
|
||||
data: T;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ export interface PageData<T> {
|
||||
list: T[];
|
||||
}
|
||||
export interface ApiResult<T> {
|
||||
code: string;
|
||||
code: number | string;
|
||||
msg: string;
|
||||
data: T;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user