✨ feat: Authentication verification code
This commit is contained in:
@@ -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 || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -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,
|
||||
|
||||
@@ -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 || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user