5.0.0 - 严重 - 已处理
tp版本:v5.1.34控制器代码:
$post=$this->request->only(['mobile','code'],'post');
$validate=new Member();
if(false===$validate->scene('updatemobile')->check($post)){
$this->error($validate->getError());
}验证器代码:public function sceneUpdatemobile(){
file_put_contents('msg1.log',time().":".'_1_'.PHP_EOL,FILE_APPEND);
return $this->append('code','checkCode')
->remove('password');
}
protected function checkCode($value,$rule,$data=[])
{
//判断短信验证码是否正确
sleep(2);
file_put_contents('msg.log',time().":".$value.'_1_'.Cache::get($data['mobile'].'_bind_mobile').PHP_EOL,FILE_APPEND);
if(!$value){
return '请填写短信验证码';
}elseif($value != Cache::get($data['mobile'].'_bind_mobile')){
return '短信验证码不正确';
}else{
//设置验证码已失效
Cache::rm($data['mobile'].'_bind_mobile');
Cache::rm($data['mobile'].'_bind_mobile_resend');
}
return true;
}日志:1550545793:0253_1_0253
1550545795:0253_1_
