Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

verify_code验证 #120

Closed
wilbur-yu opened this issue Oct 20, 2016 · 2 comments
Closed

verify_code验证 #120

wilbur-yu opened this issue Oct 20, 2016 · 2 comments

Comments

@wilbur-yu
Copy link

验证码验证时候,如果没有调用发送验证时接口,直接调用登录认证接口,verify_code验证会报未定义attempts错误.
此情况是在'非正常使用'的情况下会发生.

@ronaldxi
Copy link

ronaldxi commented Nov 2, 2016

你可以自己在validations.php中修改Validator::extend('verify_code', function ($attribute, $value)函数,来解决这个问题~~
Validator::extend('verify_code', function ($attribute, $value) {
$state = SmsManager::retrieveState();
if($state==[])
return false;
$maxAttempts = config('laravel-sms.verifyCode.maxAttempts', 0);
$attempts = $state['attempts'] + 1;
.....

@toplan
Copy link
Owner

toplan commented Nov 2, 2016

该问题同 #114

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants