Authored by hf

do fixes bug to partner login bugs

@@ -76,33 +76,17 @@ class LoginData @@ -76,33 +76,17 @@ class LoginData
76 } 76 }
77 77
78 /** 78 /**
79 - * 写入SESSION会话 79 + * 登出SESSION会话
80 * 80 *
81 * @param int $uid 用户ID 81 * @param int $uid 用户ID
82 * @return array 82 * @return array
83 */ 83 */
84 - public static function signinSession($uid) 84 + public static function signoutSession($token)
85 { 85 {
86 $param = array(); 86 $param = array();
87 - $param['uid'] = $uid;  
88 - $param['token'] = md5($uid . '#@!@#');  
89 -  
90 - return Yohobuy::get(Yohobuy::API_URL_LOGINSESSION . 'Passport/session/index', $param);  
91 - }  
92 -  
93 - /**  
94 - * 写入SESSION会话  
95 - *  
96 - * @param int $uid 用户ID  
97 - * @return array  
98 - */  
99 - public static function checkSession($uid)  
100 - {  
101 - $param = array();  
102 - $param['uid'] = $uid;  
103 - $param['token'] = md5($uid . '#@!@#'); 87 + $param['token'] = $token;
104 88
105 - return Yohobuy::get(Yohobuy::API_URL_LOGINSESSION . 'Passport/session/val', $param); 89 + return Yohobuy::get(Yohobuy::API_URL_LOGINSESSION . 'Passport/session/logout', $param);
106 } 90 }
107 91
108 } 92 }
@@ -77,7 +77,7 @@ class Call extends Factory @@ -77,7 +77,7 @@ class Call extends Factory
77 77
78 if (is_array($token) && isset($token['uid'])) 78 if (is_array($token) && isset($token['uid']))
79 { 79 {
80 - $this->client = new SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']); 80 + $this->client = new \SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
81 81
82 $userInfo = $this->client->show_user_by_id($token['uid']); 82 $userInfo = $this->client->show_user_by_id($token['uid']);
83 83
@@ -108,7 +108,7 @@ class Call extends Factory @@ -108,7 +108,7 @@ class Call extends Factory
108 108
109 if (is_array($token) && isset($token['access_token'])) 109 if (is_array($token) && isset($token['access_token']))
110 { 110 {
111 - $this->client = new SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']); 111 + $this->client = new \SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
112 112
113 $result = $this->client->friends_by_id($params['uid'], $params['cursor'], $params['count']); 113 $result = $this->client->friends_by_id($params['uid'], $params['cursor'], $params['count']);
114 114
@@ -133,7 +133,7 @@ class Call extends Factory @@ -133,7 +133,7 @@ class Call extends Factory
133 133
134 if (is_array($token) && isset($token['access_token'])) 134 if (is_array($token) && isset($token['access_token']))
135 { 135 {
136 - $this->client = new SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']); 136 + $this->client = new \SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
137 137
138 $result = $this->client->bilateral($params['uid'], $params['page'], $params['count']); 138 $result = $this->client->bilateral($params['uid'], $params['page'], $params['count']);
139 139
@@ -163,7 +163,7 @@ class Call extends Factory @@ -163,7 +163,7 @@ class Call extends Factory
163 { 163 {
164 $content .= $link; 164 $content .= $link;
165 165
166 - $this->client = new SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']); 166 + $this->client = new \SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
167 167
168 $response = $this->client->upload($content, $image); 168 $response = $this->client->upload($content, $image);
169 169
@@ -190,7 +190,7 @@ class Call extends Factory @@ -190,7 +190,7 @@ class Call extends Factory
190 190
191 if (is_array($token) && isset($token['access_token'])) 191 if (is_array($token) && isset($token['access_token']))
192 { 192 {
193 - $this->client = new SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']); 193 + $this->client = new \SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
194 194
195 if ($uid !== null) 195 if ($uid !== null)
196 { 196 {
@@ -218,7 +218,7 @@ class Call extends Factory @@ -218,7 +218,7 @@ class Call extends Factory
218 218
219 if (is_array($token) && isset($token['access_token']) && is_string($content)) 219 if (is_array($token) && isset($token['access_token']) && is_string($content))
220 { 220 {
221 - $this->client = new SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']); 221 + $this->client = new \SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
222 222
223 $this->client->update($content); 223 $this->client->update($content);
224 } 224 }
@@ -238,7 +238,7 @@ class Call extends Factory @@ -238,7 +238,7 @@ class Call extends Factory
238 { 238 {
239 if (is_array($token) && isset($token['access_token']) && isset($uid)) 239 if (is_array($token) && isset($token['access_token']) && isset($uid))
240 { 240 {
241 - $this->client = new SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']); 241 + $this->client = new \SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
242 $this->client->send_dm_by_id($uid, $content, $id); 242 $this->client->send_dm_by_id($uid, $content, $id);
243 } 243 }
244 } 244 }
@@ -16,7 +16,7 @@ class LoginController extends AbstractAction @@ -16,7 +16,7 @@ class LoginController extends AbstractAction
16 * 登录页 16 * 登录页
17 */ 17 */
18 public function indexAction() 18 public function indexAction()
19 - { 19 + {
20 $this->setTitle('登录'); 20 $this->setTitle('登录');
21 21
22 $refer = $this->get('refer'); 22 $refer = $this->get('refer');
@@ -67,14 +67,15 @@ class LoginController extends AbstractAction @@ -67,14 +67,15 @@ class LoginController extends AbstractAction
67 67
68 /** 68 /**
69 * 退出 69 * 退出
70 - *  
71 - * @todo  
72 */ 70 */
73 public function outAction() 71 public function outAction()
74 { 72 {
75 $this->setCookie('_UID', ''); 73 $this->setCookie('_UID', '');
76 74
77 $refer = $this->server('HTTP_REFERER', SITE_MAIN); 75 $refer = $this->server('HTTP_REFERER', SITE_MAIN);
  76 + $token = $this->get('token');
  77 +
  78 + LoginData::signoutSession($token);
78 79
79 $this->go($refer); 80 $this->go($refer);
80 } 81 }
@@ -126,6 +127,7 @@ class LoginController extends AbstractAction @@ -126,6 +127,7 @@ class LoginController extends AbstractAction
126 } 127 }
127 $data['data']['session'] = Helpers::syncUserSession($data['data']['uid']); 128 $data['data']['session'] = Helpers::syncUserSession($data['data']['uid']);
128 $data['data']['href'] = $refer; 129 $data['data']['href'] = $refer;
  130 +
129 } while (false); 131 } while (false);
130 132
131 $this->echoJson($data); 133 $this->echoJson($data);
@@ -40,6 +40,13 @@ routes.interational.route.module = Passport @@ -40,6 +40,13 @@ routes.interational.route.module = Passport
40 routes.interational.route.controller = Login 40 routes.interational.route.controller = Login
41 routes.interational.route.action = International 41 routes.interational.route.action = International
42 42
  43 +; 登录页
  44 +routes.logout.type = "rewrite"
  45 +routes.logout.match = "/passport/signout/index"
  46 +routes.logout.route.module = Passport
  47 +routes.logout.route.controller = Login
  48 +routes.logout.route.action = out
  49 +
43 ; 找回密码(手机号) 50 ; 找回密码(手机号)
44 routes.phoneback.type = "rewrite" 51 routes.phoneback.type = "rewrite"
45 routes.phoneback.match = "/phoneback.html" 52 routes.phoneback.match = "/phoneback.html"