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:
@@ -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 || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user