🐛 fix(locales): Add error message for incorrect user information

This commit is contained in:
web@ppanel
2025-01-28 13:43:53 +07:00
parent 331bbea45f
commit 3d92902f1b
26 changed files with 130 additions and 10 deletions
+36 -7
View File
@@ -71,6 +71,12 @@ declare namespace API {
register: RegisterConfig;
};
type AuthMethod = {
auth_type: string;
auth_identifier: string;
verified: boolean;
};
type BatchDeleteCouponRequest = {
ids: number[];
};
@@ -233,6 +239,12 @@ declare namespace API {
content: string;
};
type CreateUserAuthMethodRequest = {
user_id: number;
auth_type: string;
auth_identifier: string;
};
type CreateUserRequest = {
email: string;
telephone: string;
@@ -289,6 +301,10 @@ declare namespace API {
id: number;
};
type DeleteUserDeivceRequest = {
id: number;
};
type DeleteUserParams = {
id: number;
};
@@ -573,6 +589,14 @@ declare namespace API {
id: number;
};
type GetUserAuthMethodRequest = {
user_id: number;
};
type GetUserAuthMethodResponse = {
auth_methods: AuthMethod[];
};
type GetUserDetailParams = {
id: number;
};
@@ -1192,10 +1216,7 @@ declare namespace API {
type UpdateUserRequest = {
id: number;
email: string;
password: string;
telephone: string;
telephone_area_code: string;
avatar: string;
balance: number;
commission: number;
@@ -1205,7 +1226,6 @@ declare namespace API {
referer_id: number;
enable: boolean;
is_admin: boolean;
valid_email: boolean;
enable_email_notify: boolean;
enable_telegram_notify: boolean;
enable_balance_notify: boolean;
@@ -1216,9 +1236,6 @@ declare namespace API {
type User = {
id: number;
email: string;
telephone: string;
telephone_area_code: string;
avatar: string;
balance: number;
commission: number;
@@ -1235,6 +1252,7 @@ declare namespace API {
enable_login_notify: boolean;
enable_subscribe_notify: boolean;
enable_trade_notify: boolean;
auth_methods: AuthMethod[];
created_at: number;
updated_at: number;
deleted_at?: number;
@@ -1258,6 +1276,17 @@ declare namespace API {
created_at: number;
};
type UserDevice = {
id: number;
user_id: number;
device_number: string;
online: boolean;
last_online: number;
enabled: boolean;
created_at: number;
updated_at: number;
};
type UserStatistics = {
date?: string;
register: number;
+53
View File
@@ -41,6 +41,32 @@ export async function deleteUser(
});
}
/** Get user auth method GET /v1/admin/user/auth_method */
export async function getUserAuthMethod(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.GetUserAuthMethodResponse }>(
'/v1/admin/user/auth_method',
{
method: 'GET',
...(options || {}),
},
);
}
/** Create user auth method POST /v1/admin/user/auth_method */
export async function createUserAuthMethod(
body: API.CreateUserAuthMethodRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/user/auth_method', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Batch delete user DELETE /v1/admin/user/batch */
export async function batchDeleteUser(
body: API.BatchDeleteUserRequest,
@@ -79,6 +105,33 @@ export async function getUserDetail(
});
}
/** User device PUT /v1/admin/user/device */
export async function updaeUserDevice(body: API.UserDevice, options?: { [key: string]: any }) {
return request<API.Response & { data?: any }>('/v1/admin/user/device', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Delete user device DELETE /v1/admin/user/device */
export async function deleteUserDevice(
body: API.DeleteUserDeivceRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/user/device', {
method: 'DELETE',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Get user list GET /v1/admin/user/list */
export async function getUserList(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)