Verification
class Verification
系统校验
Traits
AppTrait
Constants
TYPE_MAIL |
|
TYPE_MOBILE |
|
CAPTCHA_SEND_TYPE_EXIST |
|
CAPTCHA_SEND_TYPE_NO_EXIST |
|
Properties
protected Resp | $error | error | from AppTrait |
protected Resp | $success | success | from AppTrait |
Methods
__construct()
No description
bool
genCaptcha(string $passport, int $expired_min = 5, int $length = 6)
No description
bool
checkCaptcha(string $passport, string $captcha, bool $forget = true)
验证验证码, 验证码验证成功仅有一次机会
bool
removeCaptcha(string $passport)
移除验证码
bool
isPassThrottle(string $key, int $seconds = 30)
限流以及提示, 开发状态下不进行限流
bool
fetchCaptcha(string $passport)
获取通行证验证码
string
genOnceVerifyCode(int $expired_min = 10, string|array $hidden_str = '')
生成一次验证码
bool
verifyOnceCode(string $code, bool $forget = true)
需要验证的验证码
bool
removeOnceCode($code)
No description
void
saveWord(string $key, string|array $word = '', int $expired_min = 5)
No description
bool
verifyWord(string $key, string|array $word = '')
验证校验值, 不进行删除
void
removeWord(string $key)
删除验证数据
getHidden()
No description
string
getCaptcha()
No description
Details
in
AppTrait at line 45
bool
setError(string|MessageBag $error)
设置错误
at line 52
__construct()
No description
at line 63
bool
genCaptcha(string $passport, int $expired_min = 5, int $length = 6)
No description
at line 96
bool
checkCaptcha(string $passport, string $captcha, bool $forget = true)
验证验证码, 验证码验证成功仅有一次机会
at line 148
bool
removeCaptcha(string $passport)
移除验证码
at line 165
bool
isPassThrottle(string $key, int $seconds = 30)
限流以及提示, 开发状态下不进行限流
at line 183
bool
fetchCaptcha(string $passport)
获取通行证验证码
at line 204
string
genOnceVerifyCode(int $expired_min = 10, string|array $hidden_str = '')
生成一次验证码
at line 225
bool
verifyOnceCode(string $code, bool $forget = true)
需要验证的验证码
at line 237
bool
removeOnceCode($code)
No description
at line 248
void
saveWord(string $key, string|array $word = '', int $expired_min = 5)
No description
at line 262
bool
verifyWord(string $key, string|array $word = '')
验证校验值, 不进行删除
at line 286
void
removeWord(string $key)
删除验证数据
at line 292
getHidden()
No description
at line 300
string
getCaptcha()
No description