Skip to content

Commit

Permalink
废除NOW_TIME常量
Browse files Browse the repository at this point in the history
  • Loading branch information
yunwuxin committed Jun 3, 2016
1 parent e1a0260 commit f7670c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Captcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function check($code, $id = '')
return false;
}
// session 过期
if (NOW_TIME - $secode['verify_time'] > $this->expire) {
if (time() - $secode['verify_time'] > $this->expire) {
Session::delete($key);
return false;
}
Expand Down Expand Up @@ -182,7 +182,7 @@ public function entry($id = '')
$code = $this->authcode(strtoupper(implode('', $code)));
$secode = [];
$secode['verify_code'] = $code; // 把校验码保存到session
$secode['verify_time'] = NOW_TIME; // 验证码创建时间
$secode['verify_time'] = time(); // 验证码创建时间
Session::set($key . $id, $secode);

header('Cache-Control: private, max-age=0, no-store, no-cache, must-revalidate');
Expand Down

0 comments on commit f7670c7

Please sign in to comment.