feat: Authentication verification code

This commit is contained in:
EUForest
2026-03-10 19:03:39 +08:00
parent 4b4edd48e3
commit eac7b27f60
30 changed files with 805 additions and 130 deletions
+17
View File
@@ -0,0 +1,17 @@
// @ts-nocheck
/* eslint-disable */
import request from "@workspace/ui/lib/request";
/** Generate captcha POST /v1/auth/admin/captcha/generate */
export async function adminGenerateCaptcha(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.GenerateCaptchaResponse }>(
`${import.meta.env.VITE_API_PREFIX || ""}/v1/auth/admin/captcha/generate`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
...(options || {}),
}
);
}
+2
View File
@@ -5,6 +5,7 @@
import * as ads from "./ads";
import * as announcement from "./announcement";
import * as application from "./application";
import * as auth from "./auth";
import * as authMethod from "./authMethod";
import * as console from "./console";
import * as coupon from "./coupon";
@@ -24,6 +25,7 @@ export default {
ads,
announcement,
application,
auth,
authMethod,
console,
coupon,
+14
View File
@@ -163,3 +163,17 @@ export async function telephoneResetPassword(
}
);
}
/** Generate captcha POST /v1/auth/captcha/generate */
export async function generateCaptcha(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.GenerateCaptchaResponse }>(
`${import.meta.env.VITE_API_PREFIX || ""}/v1/auth/captcha/generate`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
...(options || {}),
}
);
}
+5
View File
@@ -1111,9 +1111,14 @@ declare namespace API {
type VeifyConfig = {
turnstile_site_key: string;
captcha_type: string;
enable_login_verify: boolean;
enable_register_verify: boolean;
enable_reset_password_verify: boolean;
enable_user_login_captcha: boolean;
enable_user_register_captcha: boolean;
enable_user_reset_password_captcha: boolean;
enable_admin_login_captcha: boolean;
};
type VerifyCodeConfig = {