@@ -17,9 +17,13 @@ class OpenWeWork extends Base
17
17
public const NAME = 'open-wework ' ;
18
18
19
19
protected bool $ detailed = false ;
20
+
20
21
protected bool $ asQrcode = false ;
22
+
21
23
protected string $ userType = 'member ' ;
24
+
22
25
protected string $ lang = 'zh ' ;
26
+
23
27
protected ?string $ suiteTicket = null ;
24
28
25
29
protected ?int $ agentId = null ;
@@ -127,7 +131,6 @@ public function getAuthUrl(): string
127
131
return \sprintf ('https://open.work.weixin.qq.com/wwopen/sso/3rd_qrConnect?%s ' , http_build_query ($ queries ));
128
132
}
129
133
130
-
131
134
return \sprintf ('https://open.weixin.qq.com/connect/oauth2/authorize?%s#wechat_redirect ' , \http_build_query ($ queries ));
132
135
}
133
136
@@ -164,7 +167,7 @@ protected function getUser(string $token, string $code): array
164
167
$ response = $ this ->fromJsonBody ($ responseInstance );
165
168
166
169
if (($ response ['errcode ' ] ?? 1 ) > 0 || (empty ($ response ['UserId ' ]) && empty ($ response ['openid ' ]))) {
167
- throw new Exceptions \AuthorizeFailedException ((string )$ responseInstance ->getBody (), $ response );
170
+ throw new Exceptions \AuthorizeFailedException ((string ) $ responseInstance ->getBody (), $ response );
168
171
} elseif (empty ($ response ['user_ticket ' ])) {
169
172
$ this ->detailed = false ;
170
173
}
@@ -179,7 +182,7 @@ protected function getUser(string $token, string $code): array
179
182
protected function getUserByTicket (string $ userTicket ): array
180
183
{
181
184
$ responseInstance = $ this ->getHttpClient ()->post (
182
- $ this ->baseUrl . '/cgi-bin/service/auth/getuserdetail3rd ' ,
185
+ $ this ->baseUrl . '/cgi-bin/service/auth/getuserdetail3rd ' ,
183
186
[
184
187
'query ' => [
185
188
'suite_access_token ' => $ this ->getSuiteAccessToken (),
0 commit comments