直接提交
if(!captcha_check($captcha)){
return ['status'=>0,'msg'=>"$captcha"];
};
提示为空
public function check($code, $id = '')
{
$key = $this->authcode($this->seKey) . $id;
// 验证码不能为空
$secode = Session::get($key, '');
if (empty($code) || empty($secode)) {
return false; 返回这个
}
// session 过期
if (time() - $secode['verify_time'] > $this->expire) {
Session::delete($key, '');
return false;
}
if ($this->authcode(strtoupper($code)) == $secode['verify_code']) {
$this->reset && Session::delete($key, '');
return true;
}
return false;
}
最佳答案
