-
Notifications
You must be signed in to change notification settings - Fork 578
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use security svg-captcha and add more options (#4242)
- Loading branch information
1 parent
7f84d85
commit 8804ca2
Showing
5 changed files
with
91 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,26 @@ | ||
interface BaseCaptchaOptions { | ||
// 验证码长度,默认4 | ||
size?: number; | ||
// 干扰线条的数量,默认1 | ||
noise?: number; | ||
// 宽度、高度 | ||
width?: number; | ||
height?: number; | ||
import { ConfigObject } from 'svg-captcha-fixed'; | ||
|
||
export interface CaptchaCacheOptions { | ||
// 验证码过期时间,单位秒 | ||
expirationTime?: number; | ||
// 验证码 key 前缀 | ||
idPrefix?: string; | ||
} | ||
|
||
export interface CaptchaOptions extends BaseCaptchaOptions { | ||
default?: BaseCaptchaOptions; | ||
export interface CaptchaOptions extends CaptchaCacheOptions { | ||
default?: ConfigObject; | ||
image?: ImageCaptchaOptions; | ||
formula?: FormulaCaptchaOptions; | ||
text?: TextCaptchaOptions; | ||
// 验证码过期时间,默认为 1h | ||
expirationTime?: number; | ||
// 验证码key 前缀 | ||
idPrefix?: string; | ||
} | ||
|
||
export interface ImageCaptchaOptions extends BaseCaptchaOptions { | ||
export interface ImageCaptchaOptions extends ConfigObject { | ||
type?: 'number'|'letter'|'mixed'; | ||
} | ||
|
||
export interface FormulaCaptchaOptions extends BaseCaptchaOptions {} | ||
export interface FormulaCaptchaOptions extends ConfigObject {} | ||
|
||
export interface TextCaptchaOptions { | ||
size?: number; | ||
type?: 'number'|'letter'|'mixed'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters