diff --git a/app/Http/Home/Views/connect/bind_login.volt b/app/Http/Home/Views/connect/bind_login.volt index fb082ed2..1add9249 100644 --- a/app/Http/Home/Views/connect/bind_login.volt +++ b/app/Http/Home/Views/connect/bind_login.volt @@ -13,8 +13,8 @@
- - + +
\ No newline at end of file diff --git a/app/Http/Home/Views/connect/bind_register.volt b/app/Http/Home/Views/connect/bind_register.volt index c540997f..7c1f151d 100644 --- a/app/Http/Home/Views/connect/bind_register.volt +++ b/app/Http/Home/Views/connect/bind_register.volt @@ -21,8 +21,8 @@
- - + + diff --git a/app/Http/Home/Views/user/console/account_info.volt b/app/Http/Home/Views/user/console/account_info.volt index c34cf069..d275299b 100644 --- a/app/Http/Home/Views/user/console/account_info.volt +++ b/app/Http/Home/Views/user/console/account_info.volt @@ -63,28 +63,30 @@
开放登录
-
已经绑定的第三方帐号
-
- - - - - - - - - {% for connect in connects %} - {% set url = url({'for':'home.uc.unconnect','id':connect.id}) %} + {% if connects %} +
已经绑定的第三方帐号
+
+
序号提供方用户信息创建日期操作
- - - - - + + + + + - {% endfor %} -
{{ loop.index }}{{ connect_provider(connect) }}{{ connect_user(connect) }}{{ date('Y-m-d H:i',connect.create_time) }}解除绑定序号提供方用户信息创建日期操作
-
+ {% for connect in connects %} + {% set url = url({'for':'home.uc.unconnect','id':connect.id}) %} + + {{ loop.index }} + {{ connect_provider(connect) }} + {{ connect_user(connect) }} + {{ date('Y-m-d H:i',connect.create_time) }} + 解除绑定 + + {% endfor %} + +
+ {% endif %}
支持绑定的第三方帐号
diff --git a/app/Library/OAuth/QQ.php b/app/Library/OAuth/QQ.php index ba0ee84c..69d488df 100644 --- a/app/Library/OAuth/QQ.php +++ b/app/Library/OAuth/QQ.php @@ -33,7 +33,6 @@ class QQ extends OAuth 'client_secret' => $this->clientSecret, 'redirect_uri' => $this->redirectUri, 'grant_type' => 'authorization_code', - 'state' => 'ok', ]; $response = $this->httpPost(self::ACCESS_TOKEN_URL, $params); @@ -90,7 +89,7 @@ class QQ extends OAuth } if (!isset($result['openid'])) { - throw new \Exception("Fetch Openid Failed:{$response}"); + throw new \Exception("Fetch OpenId Failed:{$response}"); } return $result['openid']; @@ -100,8 +99,8 @@ class QQ extends OAuth { $data = json_decode($response, true); - if ($data['ret'] != 0) { - throw new \Exception("Fetch User Info Failed:{$data['msg']}"); + if (isset($data['ret']) && $data['ret'] != 0) { + throw new \Exception("Fetch User Info Failed:{$response}"); } $userInfo['id'] = $this->openId; diff --git a/app/Library/OAuth/WeiBo.php b/app/Library/OAuth/WeiBo.php index 9ccb0268..88f69948 100644 --- a/app/Library/OAuth/WeiBo.php +++ b/app/Library/OAuth/WeiBo.php @@ -8,7 +8,7 @@ class WeiBo extends OAuth { const AUTHORIZE_URL = 'https://api.weibo.com/oauth2/authorize'; - const ACCESS_TOKEN_URL = 'https://api.weibo.com/oauth2/oauth2/access_token'; + const ACCESS_TOKEN_URL = 'https://api.weibo.com/oauth2/access_token'; const USER_INFO_URL = 'https://api.weibo.com/2/users/show.json'; public function getAuthorizeUrl() @@ -60,8 +60,8 @@ class WeiBo extends OAuth private function parseAccessToken($response) { $data = json_decode($response, true); - - if (!isset($data['access_token']) || isset($data['uid'])) { + + if (!isset($data['access_token']) || !isset($data['uid'])) { throw new \Exception("Fetch Access Token Failed:{$response}"); } @@ -74,8 +74,8 @@ class WeiBo extends OAuth { $data = json_decode($response, true); - if ($data['error_code'] != 0) { - throw new \Exception("Fetch User Info Failed:{$data['error']}"); + if (isset($data['error_code']) && $data['error_code'] != 0) { + throw new \Exception("Fetch User Info Failed:{$response}"); } $userInfo['id'] = $this->openId; diff --git a/app/Library/OAuth/WeiXin.php b/app/Library/OAuth/WeiXin.php index 7be80e62..114a42ba 100644 --- a/app/Library/OAuth/WeiXin.php +++ b/app/Library/OAuth/WeiXin.php @@ -62,7 +62,7 @@ class WeiXin extends OAuth $data = json_decode($response, true); if (isset($data['errcode']) && $data['errcode'] != 0) { - throw new \Exception("Fetch Access Token Failed:{$data['errmsg']}"); + throw new \Exception("Fetch Access Token Failed:{$response}"); } $this->openId = $data['openid']; @@ -75,7 +75,7 @@ class WeiXin extends OAuth $data = json_decode($response, true); if (isset($data['errcode']) && $data['errcode'] != 0) { - throw new \Exception("Fetch User Info Failed:{$data['errmsg']}"); + throw new \Exception("Fetch User Info Failed:{$response}"); } $userInfo['id'] = $this->openId;