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

This commit is contained in:
web@ppanel
2025-01-28 13:44:31 +07:00
parent 3d92902f1b
commit 52c1d1fc60
27 changed files with 150 additions and 6 deletions
+44 -3
View File
@@ -63,6 +63,26 @@ declare namespace API {
register: RegisterConfig;
};
type AuthMethod = {
auth_type: string;
auth_identifier: string;
verified: boolean;
};
type BindOAuthCallbackRequest = {
method: string;
callback: Record<string, any>;
};
type BindOAuthRequest = {
method: string;
redirect: string;
};
type BindOAuthResponse = {
redirect: string;
};
type BindTelegramResponse = {
url: string;
expired_at: number;
@@ -170,6 +190,10 @@ declare namespace API {
list: PaymentConfig[];
};
type GetOAuthMethodsResponse = {
methods: AuthMethod[];
};
type GetUserTicketDetailRequest = {
id: number;
};
@@ -482,6 +506,10 @@ declare namespace API {
order_no: string;
};
type ResetUserSubscribeTokenRequest = {
user_subscribe_id: number;
};
type Response = {
/** 状态码 */
code?: number;
@@ -680,6 +708,10 @@ declare namespace API {
security_config: SecurityConfig;
};
type UnbindOAuthRequest = {
method: string;
};
type UnsubscribeRequest = {
id: number;
};
@@ -708,9 +740,6 @@ declare namespace API {
type User = {
id: number;
email: string;
telephone: string;
telephone_area_code: string;
avatar: string;
balance: number;
commission: number;
@@ -727,6 +756,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;
@@ -750,6 +780,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 UserSubscribe = {
id: number;
user_id: number;
+65
View File
@@ -42,6 +42,33 @@ export async function queryUserBalanceLog(options?: { [key: string]: any }) {
);
}
/** Bind OAuth POST /v1/public/user/bind_oauth */
export async function bindOAuth(body: API.BindOAuthRequest, options?: { [key: string]: any }) {
return request<API.Response & { data?: API.BindOAuthResponse }>('/v1/public/user/bind_oauth', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Bind OAuth Callback POST /v1/public/user/bind_oauth/callback */
export async function bindOAuthCallback(
body: API.BindOAuthCallbackRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/public/user/bind_oauth/callback', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Bind Telegram GET /v1/public/user/bind_telegram */
export async function bindTelegram(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.BindTelegramResponse }>(
@@ -109,6 +136,17 @@ export async function updateUserNotifySetting(
});
}
/** Get OAuth Methods GET /v1/public/user/oauth_methods */
export async function getOAuthMethods(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.GetOAuthMethodsResponse }>(
'/v1/public/user/oauth_methods',
{
method: 'GET',
...(options || {}),
},
);
}
/** Update User Password PUT /v1/public/user/password */
export async function updateUserPassword(
body: API.UpdateUserPasswordRequest,
@@ -135,6 +173,33 @@ export async function queryUserSubscribe(options?: { [key: string]: any }) {
);
}
/** Reset User Subscribe Token PUT /v1/public/user/subscribe_token */
export async function resetUserSubscribeToken(
body: API.ResetUserSubscribeTokenRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/public/user/subscribe_token', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Unbind OAuth POST /v1/public/user/unbind_oauth */
export async function unbindOAuth(body: API.UnbindOAuthRequest, options?: { [key: string]: any }) {
return request<API.Response & { data?: any }>('/v1/public/user/unbind_oauth', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Unbind Telegram POST /v1/public/user/unbind_telegram */
export async function unbindTelegram(options?: { [key: string]: any }) {
return request<API.Response & { data?: any }>('/v1/public/user/unbind_telegram', {