@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | 'state' => $this->config['state'] ?: '', |
31 | 31 | 'prompt' => 'consent' |
32 | 32 | ]; |
33 | - return $this->AuthorizeURL . '?' . http_build_query($params); |
|
33 | + return $this->AuthorizeURL.'?'.http_build_query($params); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | $response = json_decode($response, true); |
95 | 95 | |
96 | 96 | if (!isset($response['accessToken'])) { |
97 | - throw new OAuthException('获取钉钉 access_token 出错:' . json_encode($response)); |
|
97 | + throw new OAuthException('获取钉钉 access_token 出错:'.json_encode($response)); |
|
98 | 98 | } |
99 | 99 | return $response; |
100 | 100 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | 'state' => $this->config['state'], |
31 | 31 | 'access_type' => 'offline', |
32 | 32 | ]; |
33 | - return $this->AuthorizeURL . '?' . http_build_query($params); |
|
33 | + return $this->AuthorizeURL.'?'.http_build_query($params); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $data = json_decode($data, true); |
80 | 80 | |
81 | 81 | if (!isset($data['displayName'])) { |
82 | - throw new OAuthException('获取华为用户信息失败:' . json_encode($data)); |
|
82 | + throw new OAuthException('获取华为用户信息失败:'.json_encode($data)); |
|
83 | 83 | } |
84 | 84 | return $data; |
85 | 85 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | if (isset($data['access_token'])) { |
113 | 113 | return $data; |
114 | 114 | } |
115 | - throw new OAuthException('获取华为 access_token 出错:' . json_encode($data)); |
|
115 | + throw new OAuthException('获取华为 access_token 出错:'.json_encode($data)); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | /** |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | 'scope' => $this->config['scope'] ?: 'user_info', |
30 | 30 | 'state' => $this->config['state'] ?: '', |
31 | 31 | ]; |
32 | - return $this->AuthorizeURL . '?' . http_build_query($params); |
|
32 | + return $this->AuthorizeURL.'?'.http_build_query($params); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | /** |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $data = json_decode($data, true); |
79 | 79 | |
80 | 80 | if (!isset($data['result'])) { |
81 | - throw new OAuthException('获取快手用户信息失败:' . json_encode($data)); |
|
81 | + throw new OAuthException('获取快手用户信息失败:'.json_encode($data)); |
|
82 | 82 | } |
83 | 83 | return $data['result']; |
84 | 84 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $response = json_decode($response, true); |
100 | 100 | |
101 | 101 | if (!isset($response['access_token'])) { |
102 | - throw new OAuthException('获取快手 access_token 出错:' . json_encode($response)); |
|
102 | + throw new OAuthException('获取快手 access_token 出错:'.json_encode($response)); |
|
103 | 103 | } |
104 | 104 | return $response; |
105 | 105 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | 'redirect_uri' => $this->config['callback'], |
28 | 28 | 'state' => $this->config['state'] ?: '', |
29 | 29 | ]; |
30 | - return $this->AuthorizeURL . '?' . http_build_query($params); |
|
30 | + return $this->AuthorizeURL.'?'.http_build_query($params); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $data = json_decode($data, true); |
77 | 77 | |
78 | 78 | if (!isset($data['userid'])) { |
79 | - throw new OAuthException('获取企业微信用户信息失败:' . json_encode($data)); |
|
79 | + throw new OAuthException('获取企业微信用户信息失败:'.json_encode($data)); |
|
80 | 80 | } |
81 | 81 | return $data; |
82 | 82 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | $response = json_decode($response, true); |
96 | 96 | |
97 | 97 | if (!isset($response['access_token'])) { |
98 | - throw new OAuthException('获取企业微信 access_token 出错:' . json_encode($response)); |
|
98 | + throw new OAuthException('获取企业微信 access_token 出错:'.json_encode($response)); |
|
99 | 99 | } |
100 | 100 | return $response; |
101 | 101 | } |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | ]; |
114 | 114 | $data = $this->get($this->UserInfoURL, $params); |
115 | 115 | $data = json_decode($data, true); |
116 | - return $data['errcode'] === 40029; // 无效的code但token有效 |
|
116 | + return $data['errcode'] === 40029; // 无效的code但token有效 |
|
117 | 117 | } catch (\Exception $e) { |
118 | 118 | return false; |
119 | 119 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | 'scope' => $this->config['scope'] ?: 'profile', |
29 | 29 | 'state' => $this->config['state'], |
30 | 30 | ]; |
31 | - return $this->AuthorizeURL . '?' . http_build_query($params); |
|
31 | + return $this->AuthorizeURL.'?'.http_build_query($params); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
@@ -68,14 +68,14 @@ discard block |
||
68 | 68 | $this->getToken(); |
69 | 69 | |
70 | 70 | $headers = [ |
71 | - 'Authorization: Bearer ' . $this->token['access_token'], |
|
71 | + 'Authorization: Bearer '.$this->token['access_token'], |
|
72 | 72 | ]; |
73 | 73 | |
74 | 74 | $data = $this->get($this->UserInfoURL, [], $headers); |
75 | 75 | $data = json_decode($data, true); |
76 | 76 | |
77 | 77 | if (!isset($data['user_id'])) { |
78 | - throw new OAuthException('获取Amazon用户信息失败:' . json_encode($data)); |
|
78 | + throw new OAuthException('获取Amazon用户信息失败:'.json_encode($data)); |
|
79 | 79 | } |
80 | 80 | return $data; |
81 | 81 | } |
@@ -108,6 +108,6 @@ discard block |
||
108 | 108 | if (isset($data['access_token'])) { |
109 | 109 | return $data; |
110 | 110 | } |
111 | - throw new OAuthException('获取Amazon access_token 出错:' . json_encode($data)); |
|
111 | + throw new OAuthException('获取Amazon access_token 出错:'.json_encode($data)); |
|
112 | 112 | } |
113 | 113 | } |
114 | 114 | \ No newline at end of file |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | 'state' => $this->config['state'], |
30 | 30 | 'nonce' => md5(uniqid()), |
31 | 31 | ]; |
32 | - return $this->AuthorizeURL . '?' . http_build_query($params); |
|
32 | + return $this->AuthorizeURL.'?'.http_build_query($params); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | /** |
@@ -69,14 +69,14 @@ discard block |
||
69 | 69 | $this->getToken(); |
70 | 70 | |
71 | 71 | $headers = [ |
72 | - 'Authorization: Bearer ' . $this->token['access_token'], |
|
72 | + 'Authorization: Bearer '.$this->token['access_token'], |
|
73 | 73 | ]; |
74 | 74 | |
75 | 75 | $data = $this->get($this->UserInfoURL, [], $headers); |
76 | 76 | $data = json_decode($data, true); |
77 | 77 | |
78 | 78 | if (!isset($data['sub'])) { |
79 | - throw new OAuthException('获取Yahoo用户信息失败:' . json_encode($data)); |
|
79 | + throw new OAuthException('获取Yahoo用户信息失败:'.json_encode($data)); |
|
80 | 80 | } |
81 | 81 | return $data; |
82 | 82 | } |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | ]; |
97 | 97 | |
98 | 98 | $headers = [ |
99 | - 'Authorization: Basic ' . base64_encode($this->config['app_id'] . ':' . $this->config['app_secret']), |
|
99 | + 'Authorization: Basic '.base64_encode($this->config['app_id'].':'.$this->config['app_secret']), |
|
100 | 100 | 'Content-Type: application/x-www-form-urlencoded', |
101 | 101 | ]; |
102 | 102 | |
@@ -114,6 +114,6 @@ discard block |
||
114 | 114 | if (isset($data['access_token'])) { |
115 | 115 | return $data; |
116 | 116 | } |
117 | - throw new OAuthException('获取Yahoo access_token 出错:' . json_encode($data)); |
|
117 | + throw new OAuthException('获取Yahoo access_token 出错:'.json_encode($data)); |
|
118 | 118 | } |
119 | 119 | } |
120 | 120 | \ No newline at end of file |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | 'app_id' => 'wx6ca7410f8******', |
34 | 34 | 'app_secret' => '30a206b87b7689b19f11******', |
35 | 35 | 'callback' => $callback, |
36 | - 'scope' => 'snsapi_userinfo',//静默授权=>snsapi_base;获取用户信息=>snsapi_userinfo |
|
36 | + 'scope' => 'snsapi_userinfo', //静默授权=>snsapi_base;获取用户信息=>snsapi_userinfo |
|
37 | 37 | //'proxy_url' => 'http://www.abc.com/wx_proxy.php',//如果不需要代理请注释此行 |
38 | 38 | //'proxy_url' => 'http://www.abc.com/weixin-authorize-proxy.html',//如果不需要代理请注释此行 |
39 | 39 | ], |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | 'type' => 'applets', |
53 | 53 | ], |
54 | 54 | ], |
55 | - 'wecom' => [ // 企业微信 |
|
55 | + 'wecom' => [// 企业微信 |
|
56 | 56 | 'app_id' => 'ww1234567890******', |
57 | 57 | 'app_secret' => 'abcdefghijklmn******', |
58 | 58 | 'callback' => $callback, |
@@ -67,19 +67,19 @@ discard block |
||
67 | 67 | 'douyin'=>[ |
68 | 68 | //抖音官方:请确保授权回调域网站协议为 https |
69 | 69 | 'pc'=>[ |
70 | - 'oauth_type' => \tinymeng\OAuth2\Helper\ConstCode::TYPE_DOUYIN,//抖音douyin,头条toutiao,西瓜xigua,使用\tinymeng\OAuth2\Helper\ConstCode |
|
70 | + 'oauth_type' => \tinymeng\OAuth2\Helper\ConstCode::TYPE_DOUYIN, //抖音douyin,头条toutiao,西瓜xigua,使用\tinymeng\OAuth2\Helper\ConstCode |
|
71 | 71 | 'app_id' => 'awenvxxxxxxxx7x4', |
72 | 72 | 'app_secret' => '5cfbc25badxxxxxxxc7be8c1', |
73 | 73 | 'callback' => 'https://majiameng.com/app/douyin', |
74 | - 'scope' => 'trial.whitelist,user_info',//trial.whitelist为白名单人员权限,上线后删掉 |
|
75 | - 'optionalScope' => '',//应用授权可选作用域,多个授权作用域以英文逗号(,)分隔,每一个授权作用域后需要加上一个是否默认勾选的参数,1为默认勾选,0为默认不勾选 |
|
74 | + 'scope' => 'trial.whitelist,user_info', //trial.whitelist为白名单人员权限,上线后删掉 |
|
75 | + 'optionalScope' => '', //应用授权可选作用域,多个授权作用域以英文逗号(,)分隔,每一个授权作用域后需要加上一个是否默认勾选的参数,1为默认勾选,0为默认不勾选 |
|
76 | 76 | ], |
77 | 77 | 'mobile'=>[ |
78 | 78 | //待完善TODO... |
79 | 79 | 'app_id' => 'awenvxxxxxxxx7x4', |
80 | 80 | 'app_secret' => '5cfbc25badxxxxxxxc7be8c1', |
81 | 81 | 'callback' => 'https://majiameng.com/app/douyin', |
82 | - 'scope' => 'login_id',//login_id为静默授权 |
|
82 | + 'scope' => 'login_id', //login_id为静默授权 |
|
83 | 83 | ], |
84 | 84 | 'app'=>[ |
85 | 85 | //待完善TODO... |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | 'app_id' => '1234567890', |
172 | 172 | 'app_secret' => 'abcdefgh******', |
173 | 173 | 'callback' => $callback, |
174 | - 'scope' => 'public_profile,user_gender',//user_gender需要审核,所以不一定能获取到 |
|
174 | + 'scope' => 'public_profile,user_gender', //user_gender需要审核,所以不一定能获取到 |
|
175 | 175 | ], |
176 | 176 | 'twitter' => [ |
177 | 177 | 'app_id' => 'abcdefgh******', |