...
|
...
|
@@ -50,6 +50,11 @@ class LoginController extends AbstractAction |
|
|
*/
|
|
|
public function alipayAction()
|
|
|
{
|
|
|
$redirect = $this->_request->getServer('HTTP_REFERER', '');
|
|
|
if($redirect != '')
|
|
|
{
|
|
|
$this->setCookie('alipay_redirect', $redirect);
|
|
|
}
|
|
|
Factory::create('alipay')->getAuthorizeUrl();
|
|
|
|
|
|
exit();
|
...
|
...
|
@@ -61,6 +66,11 @@ class LoginController extends AbstractAction |
|
|
*/
|
|
|
public function qqAction()
|
|
|
{
|
|
|
$redirect = $this->_request->getServer('HTTP_REFERER', '');
|
|
|
if($redirect != '')
|
|
|
{
|
|
|
$this->setCookie('qq_redirect', $redirect);
|
|
|
}
|
|
|
Factory::create('qqconnect')->getAuthorizeUrl();
|
|
|
|
|
|
exit();
|
...
|
...
|
@@ -72,6 +82,11 @@ class LoginController extends AbstractAction |
|
|
*/
|
|
|
public function sinaAction()
|
|
|
{
|
|
|
$redirect = $this->_request->getServer('HTTP_REFERER', '');
|
|
|
if($redirect != '')
|
|
|
{
|
|
|
$this->setCookie('sina_redirect', $redirect);
|
|
|
}
|
|
|
header('Location:' . Factory::create('sinaweibo')->getAuthorizeUrl());
|
|
|
|
|
|
exit();
|
...
|
...
|
@@ -108,8 +123,11 @@ class LoginController extends AbstractAction |
|
|
|
|
|
if($result['code'] == 200)
|
|
|
{
|
|
|
echo '登陆成功';
|
|
|
$redirect = $this->_request->getCookie('alipay_redirect');
|
|
|
$redirect && $this->redirect($redirect);
|
|
|
}
|
|
|
|
|
|
$this->redirect('/');
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -121,7 +139,6 @@ class LoginController extends AbstractAction |
|
|
$access = $qqconnect->getAccessToken();
|
|
|
/* 获取QQ腾讯用户的详细信息 */
|
|
|
$partnerInfo = $qqconnect->getUserInfo($access);
|
|
|
var_dump($access, $partnerInfo);
|
|
|
|
|
|
if ($partnerInfo && is_array($partnerInfo))
|
|
|
{
|
...
|
...
|
@@ -129,9 +146,12 @@ class LoginController extends AbstractAction |
|
|
|
|
|
if($result['code'] == 200)
|
|
|
{
|
|
|
echo '登陆成功';
|
|
|
$redirect = $this->_request->getCookie('qq_redirect');
|
|
|
$redirect && $this->redirect($redirect);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$this->redirect('/');
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -143,7 +163,6 @@ class LoginController extends AbstractAction |
|
|
$access = $sina->getAccessToken();
|
|
|
/* 获取QQ腾讯用户的详细信息 */
|
|
|
$partnerInfo = $sina->getUserInfo($access);
|
|
|
var_dump($access, $partnerInfo);
|
|
|
|
|
|
if ($partnerInfo && is_array($partnerInfo))
|
|
|
{
|
...
|
...
|
@@ -151,8 +170,11 @@ class LoginController extends AbstractAction |
|
|
|
|
|
if($result['code'] == 200)
|
|
|
{
|
|
|
echo '登陆成功';
|
|
|
$redirect = $this->_request->getCookie('sina_redirect');
|
|
|
$redirect && $this->redirect($redirect);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$this->redirect('/');
|
|
|
}
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|