...
|
...
|
@@ -44,6 +44,9 @@ class LoginController extends AbstractAction |
|
|
|
|
|
// 渲染模板
|
|
|
$this->_view->display('index', $data);
|
|
|
|
|
|
// 设置登录有效时间30分钟, 防机器刷
|
|
|
$this->setSession('_LOGIN_EXPIRE', time() + 1800);
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -67,6 +70,9 @@ class LoginController extends AbstractAction |
|
|
$data['countrys'] = RegData::getAreasData(); // 地区信息列表
|
|
|
// 渲染模板
|
|
|
$this->_view->display('international', $data);
|
|
|
|
|
|
// 设置登录有效时间30分钟, 防机器刷
|
|
|
$this->setSession('_LOGIN_EXPIRE', time() + 1800);
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -80,6 +86,7 @@ class LoginController extends AbstractAction |
|
|
$this->setCookie('_SPK', '');
|
|
|
// 清除服务端会话
|
|
|
$this->setSession('_TOKEN', '');
|
|
|
$this->setSession('_LOGIN_UID', '');
|
|
|
|
|
|
$refer = $this->server('HTTP_REFERER', SITE_MAIN);
|
|
|
$token = $this->get('token');
|
...
|
...
|
@@ -123,6 +130,12 @@ class LoginController extends AbstractAction |
|
|
break;
|
|
|
}
|
|
|
|
|
|
/* 设置登录有效时间30分钟, 防机器刷 */
|
|
|
$expire = $this->getSession('_LOGIN_EXPIRE');
|
|
|
if (empty($expire) || $expire < time()) {
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
/* 调用登录接口进行登录 */
|
|
|
// 获取未登录时的唯一识别码
|
|
|
$shoppingKey = Helpers::getShoppingKeyByCookie();
|
...
|
...
|
@@ -143,6 +156,8 @@ class LoginController extends AbstractAction |
|
|
$token = Helpers::makeToken($data['data']['uid']);
|
|
|
$this->setCookie('_TOKEN', $token);
|
|
|
$this->setSession('_TOKEN', $token);
|
|
|
$this->setSession('_LOGIN_UID', $data['data']['uid']);
|
|
|
|
|
|
} while (false);
|
|
|
|
|
|
$this->echoJson($data);
|
...
|
...
|
@@ -213,6 +228,7 @@ class LoginController extends AbstractAction |
|
|
$token = Helpers::makeToken($result['data']['uid']);
|
|
|
$this->setCookie('_TOKEN', $token);
|
|
|
$this->setSession('_TOKEN', $token);
|
|
|
$this->setSession('_LOGIN_UID', $result['data']['uid']);
|
|
|
$this->go(Helpers::syncUserSession($result['data']['uid'], $refer));
|
|
|
} else {
|
|
|
$this->go($refer);
|
...
|
...
|
@@ -250,6 +266,7 @@ class LoginController extends AbstractAction |
|
|
$token = Helpers::makeToken($result['data']['uid']);
|
|
|
$this->setCookie('_TOKEN', $token);
|
|
|
$this->setSession('_TOKEN', $token);
|
|
|
$this->setSession('_LOGIN_UID', $result['data']['uid']);
|
|
|
$this->go(Helpers::syncUserSession($result['data']['uid'], $refer));
|
|
|
} else {
|
|
|
$this->go($refer);
|
...
|
...
|
@@ -287,6 +304,7 @@ class LoginController extends AbstractAction |
|
|
$token = Helpers::makeToken($result['data']['uid']);
|
|
|
$this->setCookie('_TOKEN', $token);
|
|
|
$this->setSession('_TOKEN', $token);
|
|
|
$this->setSession('_LOGIN_UID', $result['data']['uid']);
|
|
|
$this->go(Helpers::syncUserSession($result['data']['uid'], $refer));
|
|
|
} else {
|
|
|
$this->go($refer);
|
...
|
...
|
|