...
|
...
|
@@ -21,10 +21,18 @@ class LoginController extends WebAction |
|
|
$this->setSession('_LOGIN_EXPIRE', time() + 1800);
|
|
|
|
|
|
//登录后跳转页面
|
|
|
$refer = empty($_SERVER["HTTP_REFERER"]) ? '' : $_SERVER["HTTP_REFERER"];
|
|
|
$getRefer = $this->get('refer');
|
|
|
$httpRefer = isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : '';
|
|
|
$refer = $getRefer ? $getRefer : $httpRefer;
|
|
|
//检查refre是否为绝对路径,补www.yohobuy.com
|
|
|
if (!strstr($refer, 'http')) {
|
|
|
$refer = SITE_MAIN . $refer;
|
|
|
}
|
|
|
|
|
|
if (!empty($refer)) {
|
|
|
$this->setCookie('refer', $refer);
|
|
|
}
|
|
|
|
|
|
$simpleHeader = PassportModel::getSimpleHeader();
|
|
|
//获取登陆页左侧资源
|
|
|
$cover = PassportModel::getLeftBanner(PassportModel::SIGNIN_LEFT_BANNER_CODE);
|
...
|
...
|
@@ -62,7 +70,7 @@ class LoginController extends WebAction |
|
|
*/
|
|
|
public function authAction()
|
|
|
{
|
|
|
$data = array('code' => 400, 'message' => '您输入的密码及账户名不匹配,是否忘记密码?', 'data' => '');
|
|
|
$data = array('code' => 400, 'message' => '您输入的密码及账户名不匹配,是否<a href="'.Helpers::url('/passport/back/index').'" target="_blank">忘记密码?</a>', 'data' => '');
|
|
|
do {
|
|
|
/* 判断是不是AJAX请求 */
|
|
|
if (!$this->isAjax()) {
|
...
|
...
|
@@ -101,18 +109,17 @@ class LoginController extends WebAction |
|
|
$ip = Helpers::getClientIp();
|
|
|
$ipKey = md5('ip_signin_' . $ip);
|
|
|
$accountKey = md5('account_signin_' . $account);
|
|
|
if(!Cache::get($ipKey)){
|
|
|
if (!Cache::get($ipKey)) {
|
|
|
Cache::set($ipKey, 0);
|
|
|
}
|
|
|
if(!Cache::get($accountKey)){
|
|
|
if (!Cache::get($accountKey)) {
|
|
|
Cache::set($accountKey, 0);
|
|
|
}
|
|
|
Cache::increment($accountKey, 1, 0, 1800);
|
|
|
Cache::increment($ipKey, 1, 0, 3600);
|
|
|
$accountTimes = Cache::get($accountKey);
|
|
|
$ipTimes = Cache::get($ipKey);
|
|
|
if ($accountTimes > 10) {
|
|
|
$data = array('code' => 400, 'message' => '您输入的密码及账户名不匹配,是否忘记密码?', 'data' => '');
|
|
|
$data = array('code' => 400, 'message' => '您的账号已被暂时锁定,请稍后再试', 'data' => '');
|
|
|
break;
|
|
|
}
|
|
|
if ($ipTimes > 100) {
|
...
|
...
|
@@ -121,7 +128,8 @@ class LoginController extends WebAction |
|
|
}
|
|
|
$data = LoginData::signin($area, $account, $password, $shoppingKey);
|
|
|
if (!isset($data['code']) || $data['code'] != 200 || !isset($data['data']['uid'])) {
|
|
|
$data = array('code' => 400, 'message' => '您输入的密码及账户名不匹配,是否忘记密码?', 'data' => '');
|
|
|
Cache::increment($accountKey, 1, 0, 1800);
|
|
|
$data = array('code' => 400, 'message' => '您输入的密码及账户名不匹配,是否<a href="'.Helpers::url('/passport/back/index').'" target="_blank">忘记密码?</a>', 'data' => '');
|
|
|
break;
|
|
|
}
|
|
|
|
...
|
...
|
|