Authored by hf

do fixes bug to partner login bugs

... ... @@ -76,33 +76,17 @@ class LoginData
}
/**
* 写入SESSION会话
* 登出SESSION会话
*
* @param int $uid 用户ID
* @return array
*/
public static function signinSession($uid)
public static function signoutSession($token)
{
$param = array();
$param['uid'] = $uid;
$param['token'] = md5($uid . '#@!@#');
return Yohobuy::get(Yohobuy::API_URL_LOGINSESSION . 'Passport/session/index', $param);
}
/**
* 写入SESSION会话
*
* @param int $uid 用户ID
* @return array
*/
public static function checkSession($uid)
{
$param = array();
$param['uid'] = $uid;
$param['token'] = md5($uid . '#@!@#');
$param['token'] = $token;
return Yohobuy::get(Yohobuy::API_URL_LOGINSESSION . 'Passport/session/val', $param);
return Yohobuy::get(Yohobuy::API_URL_LOGINSESSION . 'Passport/session/logout', $param);
}
}
... ...
... ... @@ -77,7 +77,7 @@ class Call extends Factory
if (is_array($token) && isset($token['uid']))
{
$this->client = new SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
$this->client = new \SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
$userInfo = $this->client->show_user_by_id($token['uid']);
... ... @@ -108,7 +108,7 @@ class Call extends Factory
if (is_array($token) && isset($token['access_token']))
{
$this->client = new SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
$this->client = new \SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
$result = $this->client->friends_by_id($params['uid'], $params['cursor'], $params['count']);
... ... @@ -133,7 +133,7 @@ class Call extends Factory
if (is_array($token) && isset($token['access_token']))
{
$this->client = new SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
$this->client = new \SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
$result = $this->client->bilateral($params['uid'], $params['page'], $params['count']);
... ... @@ -163,7 +163,7 @@ class Call extends Factory
{
$content .= $link;
$this->client = new SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
$this->client = new \SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
$response = $this->client->upload($content, $image);
... ... @@ -190,7 +190,7 @@ class Call extends Factory
if (is_array($token) && isset($token['access_token']))
{
$this->client = new SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
$this->client = new \SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
if ($uid !== null)
{
... ... @@ -218,7 +218,7 @@ class Call extends Factory
if (is_array($token) && isset($token['access_token']) && is_string($content))
{
$this->client = new SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
$this->client = new \SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
$this->client->update($content);
}
... ... @@ -238,7 +238,7 @@ class Call extends Factory
{
if (is_array($token) && isset($token['access_token']) && isset($uid))
{
$this->client = new SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
$this->client = new \SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
$this->client->send_dm_by_id($uid, $content, $id);
}
}
... ...
... ... @@ -16,7 +16,7 @@ class LoginController extends AbstractAction
* 登录页
*/
public function indexAction()
{
{
$this->setTitle('登录');
$refer = $this->get('refer');
... ... @@ -67,14 +67,15 @@ class LoginController extends AbstractAction
/**
* 退出
*
* @todo
*/
public function outAction()
{
$this->setCookie('_UID', '');
$refer = $this->server('HTTP_REFERER', SITE_MAIN);
$token = $this->get('token');
LoginData::signoutSession($token);
$this->go($refer);
}
... ... @@ -126,6 +127,7 @@ class LoginController extends AbstractAction
}
$data['data']['session'] = Helpers::syncUserSession($data['data']['uid']);
$data['data']['href'] = $refer;
} while (false);
$this->echoJson($data);
... ...
... ... @@ -40,6 +40,13 @@ routes.interational.route.module = Passport
routes.interational.route.controller = Login
routes.interational.route.action = International
; 登录页
routes.logout.type = "rewrite"
routes.logout.match = "/passport/signout/index"
routes.logout.route.module = Passport
routes.logout.route.controller = Login
routes.logout.route.action = out
; 找回密码(手机号)
routes.phoneback.type = "rewrite"
routes.phoneback.match = "/phoneback.html"
... ...