merge: 同步 upstream/main 新功能到定制版本

- feat: Add slider verification code (bd67997)
- fix bug: Inventory cannot be zero (1f7a6ee)
- fix: resolve merge conflicts and lint errors
This commit is contained in:
2026-03-23 21:50:10 -07:00
parent 3806264343
commit d6616c5859
63 changed files with 3111 additions and 1130 deletions
+54
View File
@@ -2,6 +2,42 @@
/* eslint-disable */
import request from "@workspace/ui/lib/request";
/** Admin login POST /v1/auth/admin/login */
export async function adminLogin(
body: API.UserLoginRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.LoginResponse }>(
`${import.meta.env.VITE_API_PREFIX || ""}/v1/auth/admin/login`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
}
);
}
/** Admin reset password POST /v1/auth/admin/reset */
export async function adminResetPassword(
body: API.ResetPasswordRequest,
options?: { [key: string]: any }
) {
return request<API.Response>(
`${import.meta.env.VITE_API_PREFIX || ""}/v1/auth/admin/reset`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
}
);
}
/** Generate captcha POST /v1/auth/admin/captcha/generate */
export async function adminGenerateCaptcha(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.GenerateCaptchaResponse }>(
@@ -15,3 +51,21 @@ export async function adminGenerateCaptcha(options?: { [key: string]: any }) {
}
);
}
/** Verify slider captcha POST /v1/auth/admin/captcha/slider/verify */
export async function adminVerifyCaptchaSlider(
body: { id: string; x: number; y: number; trail: string },
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.SliderVerifyCaptchaResponse }>(
`${import.meta.env.VITE_API_PREFIX || ""}/v1/auth/admin/captcha/slider/verify`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
}
);
}
+7 -5
View File
@@ -180,10 +180,12 @@ export async function updateSubscribeMapping(
}
/** Get subscribe group mapping GET /v1/admin/group/subscribe/mapping */
export async function getSubscribeGroupMapping(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.GetSubscribeGroupMappingResponse }>(
export async function getSubscribeGroupMapping(options?: {
[key: string]: any;
}) {
return request<
API.Response & { data?: API.GetSubscribeGroupMappingResponse }
>(
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/group/subscribe/mapping`,
{
method: "GET",
@@ -298,7 +300,7 @@ export async function exportGroupResult(
{
method: "GET",
params: params || {},
responseType: 'blob',
responseType: "blob",
...(options || {}),
}
);
+2 -2
View File
@@ -2807,7 +2807,7 @@ declare namespace API {
list: RedemptionRecord[];
};
type Subscribe = {
type SubscribeSimple = {
id: number;
name: string;
unit_price: number;
@@ -2830,7 +2830,7 @@ declare namespace API {
id: number;
subscribe_id: number;
user_group_id: number;
subscribe?: Subscribe;
subscribe?: SubscribeSimple;
user_group?: UserGroup;
created_at: number;
updated_at: number;