登录功能接入验证码

This commit is contained in:
2026-05-16 12:11:22 +08:00
parent 4c2d41b699
commit e0f6175fed
7 changed files with 203 additions and 50 deletions
+7 -2
View File
@@ -2,9 +2,13 @@ import { CaptchaConfig, TianAiCaptcha } from "./captcha/captcha.js"
export type TianAiCaptchaBindTarget = string | HTMLElement
export interface TianAiCaptchaResult {
id: string
data: Record<string, any>
}
export interface TianAiCaptchaStyle {
btnUrl?: string
logoUrl?: string | null
bgUrl?: string
moveTrackMaskBgColor?: string
moveTrackMaskBorderColor?: string
@@ -14,11 +18,12 @@ export interface TianAiCaptchaStyle {
export interface TianAiCaptchaConfig {
bindEl: TianAiCaptchaBindTarget
requestCaptchaDataUrl: string
validCaptchaUrl: string
validCaptchaUrl?: string
requestHeaders?: Record<string, string>
timeToTimestamp?: boolean
validSuccess?: (res: any, captcha: any, tac: TianAiCaptchaInstance) => void
validFail?: (res: any, captcha: any, tac: TianAiCaptchaInstance) => void
onDataReady?: (result: TianAiCaptchaResult, captcha: any, tac: TianAiCaptchaInstance) => void | Promise<void>
btnRefreshFun?: (el: Event, tac: TianAiCaptchaInstance) => void
btnCloseFun?: (el: Event, tac: TianAiCaptchaInstance) => void
}