...
|
...
|
@@ -17,6 +17,9 @@ class LoginController extends AbstractAction |
|
|
*/
|
|
|
public function indexAction()
|
|
|
{
|
|
|
// 设置登录有效时间30分钟, 防机器刷
|
|
|
$this->setSession('_LOGIN_EXPIRE', time() + 1800);
|
|
|
|
|
|
// 清除客户端
|
|
|
$this->setCookie('_UID', '');
|
|
|
$this->setCookie('_TOKEN', '');
|
...
|
...
|
@@ -44,9 +47,6 @@ class LoginController extends AbstractAction |
|
|
|
|
|
// 渲染模板
|
|
|
$this->_view->display('index', $data);
|
|
|
|
|
|
// 设置登录有效时间30分钟, 防机器刷
|
|
|
$this->setSession('_LOGIN_EXPIRE', time() + 1800);
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -54,6 +54,9 @@ class LoginController extends AbstractAction |
|
|
*/
|
|
|
public function internationalAction()
|
|
|
{
|
|
|
// 设置登录有效时间30分钟, 防机器刷
|
|
|
$this->setSession('_LOGIN_EXPIRE', time() + 1800);
|
|
|
|
|
|
$refer = $this->get('refer');
|
|
|
if (!empty($refer)) {
|
|
|
$this->setCookie('refer', $refer);
|
...
|
...
|
@@ -70,9 +73,6 @@ class LoginController extends AbstractAction |
|
|
$data['countrys'] = RegData::getAreasData(); // 地区信息列表
|
|
|
// 渲染模板
|
|
|
$this->_view->display('international', $data);
|
|
|
|
|
|
// 设置登录有效时间30分钟, 防机器刷
|
|
|
$this->setSession('_LOGIN_EXPIRE', time() + 1800);
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -129,13 +129,13 @@ class LoginController extends AbstractAction |
|
|
if (!$verifyEmail && !$verifyMobile) {
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
|
|
|
/* 设置登录有效时间30分钟, 防机器刷 */
|
|
|
$expire = $this->getSession('_LOGIN_EXPIRE');
|
|
|
if (empty($expire) || $expire < time()) {
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
|
|
|
/* 调用登录接口进行登录 */
|
|
|
// 获取未登录时的唯一识别码
|
|
|
$shoppingKey = Helpers::getShoppingKeyByCookie();
|
...
|
...
|
@@ -157,7 +157,6 @@ class LoginController extends AbstractAction |
|
|
$this->setCookie('_TOKEN', $token);
|
|
|
$this->setSession('_TOKEN', $token);
|
|
|
$this->setSession('_LOGIN_UID', $data['data']['uid']);
|
|
|
|
|
|
} while (false);
|
|
|
|
|
|
$this->echoJson($data);
|
...
|
...
|
@@ -226,9 +225,9 @@ class LoginController extends AbstractAction |
|
|
|
|
|
if (isset($result['code']) && $result['code'] == 200 && !empty($result['data']['uid'])) {
|
|
|
$token = Helpers::makeToken($result['data']['uid']);
|
|
|
$this->setCookie('_TOKEN', $token);
|
|
|
$this->setSession('_TOKEN', $token);
|
|
|
$this->setSession('_LOGIN_UID', $result['data']['uid']);
|
|
|
$this->setCookie('_TOKEN', $token);
|
|
|
$this->go(Helpers::syncUserSession($result['data']['uid'], $refer));
|
|
|
} else {
|
|
|
$this->go($refer);
|
...
|
...
|
@@ -264,9 +263,9 @@ class LoginController extends AbstractAction |
|
|
|
|
|
if (isset($result['code']) && $result['code'] == 200 && !empty($result['data']['uid'])) {
|
|
|
$token = Helpers::makeToken($result['data']['uid']);
|
|
|
$this->setCookie('_TOKEN', $token);
|
|
|
$this->setSession('_TOKEN', $token);
|
|
|
$this->setSession('_LOGIN_UID', $result['data']['uid']);
|
|
|
$this->setCookie('_TOKEN', $token);
|
|
|
$this->go(Helpers::syncUserSession($result['data']['uid'], $refer));
|
|
|
} else {
|
|
|
$this->go($refer);
|
...
|
...
|
@@ -302,9 +301,9 @@ class LoginController extends AbstractAction |
|
|
|
|
|
if (isset($result['code']) && $result['code'] == 200 && !empty($result['data']['uid'])) {
|
|
|
$token = Helpers::makeToken($result['data']['uid']);
|
|
|
$this->setCookie('_TOKEN', $token);
|
|
|
$this->setSession('_TOKEN', $token);
|
|
|
$this->setSession('_LOGIN_UID', $result['data']['uid']);
|
|
|
$this->setCookie('_TOKEN', $token);
|
|
|
$this->go(Helpers::syncUserSession($result['data']['uid'], $refer));
|
|
|
} else {
|
|
|
$this->go($refer);
|
...
|
...
|
|