...
|
...
|
@@ -16,14 +16,20 @@ class LoginController extends AbstractAction |
|
|
* 登录页
|
|
|
*/
|
|
|
public function indexAction()
|
|
|
{
|
|
|
$this->setTitle('登录');
|
|
|
|
|
|
{
|
|
|
$refer = $this->get('refer');
|
|
|
// 已登录则直接跳回
|
|
|
$uid = $this->getUid();
|
|
|
if ($uid) {
|
|
|
$refer = empty($refer) ? SITE_MAIN . '/?go=1' : rawurldecode($refer);
|
|
|
$this->go($refer);
|
|
|
}
|
|
|
if (!empty($refer)) {
|
|
|
$this->setCookie('refer', $refer);
|
|
|
}
|
|
|
|
|
|
$this->setTitle('登录');
|
|
|
|
|
|
$data = array(
|
|
|
'loginIndex' => true, // 模板中使用JS的标识
|
|
|
'backUrl' => '/', // 返回的URL链接
|
...
|
...
|
@@ -47,13 +53,19 @@ class LoginController extends AbstractAction |
|
|
*/
|
|
|
public function internationalAction()
|
|
|
{
|
|
|
$this->setTitle('国际账号登录');
|
|
|
|
|
|
$refer = $this->get('refer');
|
|
|
// 已登录则直接跳回
|
|
|
$uid = $this->getUid();
|
|
|
if ($uid) {
|
|
|
$refer = empty($refer) ? SITE_MAIN . '/?go=1' : rawurldecode($refer);
|
|
|
$this->go($refer);
|
|
|
}
|
|
|
if (!empty($refer)) {
|
|
|
$this->setCookie('refer', $refer);
|
|
|
}
|
|
|
|
|
|
$this->setTitle('国际账号登录');
|
|
|
|
|
|
$data = array();
|
|
|
$data['loginInternational'] = true; // 模板中使用JS的标识
|
|
|
$data['backUrl'] = '/'; // 返回的URL链接
|
...
|
...
|
@@ -61,6 +73,7 @@ class LoginController extends AbstractAction |
|
|
$data['isPassportPage'] = true; // 模板中模块标识
|
|
|
$data['areaCode'] = '+86'; // 默认区号
|
|
|
$data['countrys'] = RegData::getAreasData(); // 地区信息列表
|
|
|
|
|
|
// 渲染模板
|
|
|
$this->_view->display('international', $data);
|
|
|
}
|
...
|
...
|
@@ -74,7 +87,7 @@ class LoginController extends AbstractAction |
|
|
|
|
|
$refer = $this->server('HTTP_REFERER', SITE_MAIN);
|
|
|
$token = $this->get('token');
|
|
|
|
|
|
|
|
|
LoginData::signoutSession($token);
|
|
|
|
|
|
$this->go($refer);
|
...
|
...
|
@@ -127,7 +140,6 @@ class LoginController extends AbstractAction |
|
|
}
|
|
|
$data['data']['session'] = Helpers::syncUserSession($data['data']['uid']);
|
|
|
$data['data']['href'] = $refer;
|
|
|
|
|
|
} while (false);
|
|
|
|
|
|
$this->echoJson($data);
|
...
|
...
|
@@ -174,14 +186,14 @@ class LoginController extends AbstractAction |
|
|
if (isset($realName, $email, $userId)) {
|
|
|
$result = LoginData::signinByOpenID($realName, $userId, 'alipay');
|
|
|
}
|
|
|
|
|
|
|
|
|
$refer = $this->getCookie('refer');
|
|
|
if (empty($refer)) {
|
|
|
$refer = SITE_MAIN . '/?go=1';
|
|
|
} else {
|
|
|
$refer = rawurldecode($refer);
|
|
|
}
|
|
|
|
|
|
|
|
|
if ($result['code'] == 200 && !empty($result['data']['uid'])) {
|
|
|
$this->go(Helpers::syncUserSession($result['data']['uid'], $refer));
|
|
|
} else {
|
...
|
...
|
@@ -201,7 +213,7 @@ class LoginController extends AbstractAction |
|
|
|
|
|
$result = array();
|
|
|
if ($partnerInfo && is_array($partnerInfo)) {
|
|
|
$result = LoginData::signinByOpenID($partnerInfo['nickname'], $access['openid'], 'qq');
|
|
|
$result = LoginData::signinByOpenID($partnerInfo['nickname'], $access['openid'], 'qq');
|
|
|
}
|
|
|
|
|
|
$refer = $this->getCookie('refer');
|
...
|
...
|
@@ -210,7 +222,7 @@ class LoginController extends AbstractAction |
|
|
} else {
|
|
|
$refer = rawurldecode($refer);
|
|
|
}
|
|
|
|
|
|
|
|
|
if ($result['code'] == 200 && !empty($result['data']['uid'])) {
|
|
|
$this->go(Helpers::syncUserSession($result['data']['uid'], $refer));
|
|
|
} else {
|
...
|
...
|
@@ -239,7 +251,7 @@ class LoginController extends AbstractAction |
|
|
} else {
|
|
|
$refer = rawurldecode($refer);
|
|
|
}
|
|
|
|
|
|
|
|
|
if ($result['code'] == 200 && !empty($result['data']['uid'])) {
|
|
|
$this->go(Helpers::syncUserSession($result['data']['uid'], $refer));
|
|
|
} else {
|
...
|
...
|
|