|
@@ -21,10 +21,18 @@ class LoginController extends WebAction |
|
@@ -21,10 +21,18 @@ class LoginController extends WebAction |
21
|
$this->setSession('_LOGIN_EXPIRE', time() + 1800);
|
21
|
$this->setSession('_LOGIN_EXPIRE', time() + 1800);
|
22
|
|
22
|
|
23
|
//登录后跳转页面
|
23
|
//登录后跳转页面
|
24
|
- $refer = empty($_SERVER["HTTP_REFERER"]) ? '' : $_SERVER["HTTP_REFERER"];
|
24
|
+ $getRefer = $this->get('refer');
|
|
|
25
|
+ $httpRefer = isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : '';
|
|
|
26
|
+ $refer = $getRefer ? $getRefer : $httpRefer;
|
|
|
27
|
+ //检查refre是否为绝对路径,补www.yohobuy.com
|
|
|
28
|
+ if (!strstr($refer, 'http')) {
|
|
|
29
|
+ $refer = SITE_MAIN . $refer;
|
|
|
30
|
+ }
|
|
|
31
|
+
|
25
|
if (!empty($refer)) {
|
32
|
if (!empty($refer)) {
|
26
|
$this->setCookie('refer', $refer);
|
33
|
$this->setCookie('refer', $refer);
|
27
|
}
|
34
|
}
|
|
|
35
|
+
|
28
|
$simpleHeader = PassportModel::getSimpleHeader();
|
36
|
$simpleHeader = PassportModel::getSimpleHeader();
|
29
|
//获取登陆页左侧资源
|
37
|
//获取登陆页左侧资源
|
30
|
$cover = PassportModel::getLeftBanner(PassportModel::SIGNIN_LEFT_BANNER_CODE);
|
38
|
$cover = PassportModel::getLeftBanner(PassportModel::SIGNIN_LEFT_BANNER_CODE);
|
|
@@ -62,7 +70,7 @@ class LoginController extends WebAction |
|
@@ -62,7 +70,7 @@ class LoginController extends WebAction |
62
|
*/
|
70
|
*/
|
63
|
public function authAction()
|
71
|
public function authAction()
|
64
|
{
|
72
|
{
|
65
|
- $data = array('code' => 400, 'message' => '您输入的密码及账户名不匹配,是否忘记密码?', 'data' => '');
|
73
|
+ $data = array('code' => 400, 'message' => '您输入的密码及账户名不匹配,是否<a href="'.Helpers::url('/passport/back/index').'" target="_blank">忘记密码?</a>', 'data' => '');
|
66
|
do {
|
74
|
do {
|
67
|
/* 判断是不是AJAX请求 */
|
75
|
/* 判断是不是AJAX请求 */
|
68
|
if (!$this->isAjax()) {
|
76
|
if (!$this->isAjax()) {
|
|
@@ -101,18 +109,17 @@ class LoginController extends WebAction |
|
@@ -101,18 +109,17 @@ class LoginController extends WebAction |
101
|
$ip = Helpers::getClientIp();
|
109
|
$ip = Helpers::getClientIp();
|
102
|
$ipKey = md5('ip_signin_' . $ip);
|
110
|
$ipKey = md5('ip_signin_' . $ip);
|
103
|
$accountKey = md5('account_signin_' . $account);
|
111
|
$accountKey = md5('account_signin_' . $account);
|
104
|
- if(!Cache::get($ipKey)){
|
112
|
+ if (!Cache::get($ipKey)) {
|
105
|
Cache::set($ipKey, 0);
|
113
|
Cache::set($ipKey, 0);
|
106
|
}
|
114
|
}
|
107
|
- if(!Cache::get($accountKey)){
|
115
|
+ if (!Cache::get($accountKey)) {
|
108
|
Cache::set($accountKey, 0);
|
116
|
Cache::set($accountKey, 0);
|
109
|
}
|
117
|
}
|
110
|
- Cache::increment($accountKey, 1, 0, 1800);
|
|
|
111
|
Cache::increment($ipKey, 1, 0, 3600);
|
118
|
Cache::increment($ipKey, 1, 0, 3600);
|
112
|
$accountTimes = Cache::get($accountKey);
|
119
|
$accountTimes = Cache::get($accountKey);
|
113
|
$ipTimes = Cache::get($ipKey);
|
120
|
$ipTimes = Cache::get($ipKey);
|
114
|
if ($accountTimes > 10) {
|
121
|
if ($accountTimes > 10) {
|
115
|
- $data = array('code' => 400, 'message' => '您输入的密码及账户名不匹配,是否忘记密码?', 'data' => '');
|
122
|
+ $data = array('code' => 400, 'message' => '您的账号已被暂时锁定,请稍后再试', 'data' => '');
|
116
|
break;
|
123
|
break;
|
117
|
}
|
124
|
}
|
118
|
if ($ipTimes > 100) {
|
125
|
if ($ipTimes > 100) {
|
|
@@ -121,7 +128,8 @@ class LoginController extends WebAction |
|
@@ -121,7 +128,8 @@ class LoginController extends WebAction |
121
|
}
|
128
|
}
|
122
|
$data = LoginData::signin($area, $account, $password, $shoppingKey);
|
129
|
$data = LoginData::signin($area, $account, $password, $shoppingKey);
|
123
|
if (!isset($data['code']) || $data['code'] != 200 || !isset($data['data']['uid'])) {
|
130
|
if (!isset($data['code']) || $data['code'] != 200 || !isset($data['data']['uid'])) {
|
124
|
- $data = array('code' => 400, 'message' => '您输入的密码及账户名不匹配,是否忘记密码?', 'data' => '');
|
131
|
+ Cache::increment($accountKey, 1, 0, 1800);
|
|
|
132
|
+ $data = array('code' => 400, 'message' => '您输入的密码及账户名不匹配,是否<a href="'.Helpers::url('/passport/back/index').'" target="_blank">忘记密码?</a>', 'data' => '');
|
125
|
break;
|
133
|
break;
|
126
|
}
|
134
|
}
|
127
|
|
135
|
|