@@ -427,22 +427,13 @@ public String oauth2buildAuthorizationUrl(String state) {
427
427
428
428
@ Override
429
429
public String [] oauth2getUserInfo (String code ) throws WxErrorException {
430
- String url = "https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo?" ;
431
- url += "access_token=" + wxCpConfigStorage .getAccessToken ();
432
- url += "&code=" + code ;
433
- url += "&agendid=" + wxCpConfigStorage .getAgentId ();
434
-
435
- try {
436
- RequestExecutor <String , String > executor = new SimpleGetRequestExecutor ();
437
- String responseText = executor .execute (getHttpclient (), httpProxy , url , null );
438
- JsonElement je = Streams .parse (new JsonReader (new StringReader (responseText )));
439
- JsonObject jo = je .getAsJsonObject ();
440
- return new String [] {GsonHelper .getString (jo , "UserId" ), GsonHelper .getString (jo , "DeviceId" )};
441
- } catch (ClientProtocolException e ) {
442
- throw new RuntimeException (e );
443
- } catch (IOException e ) {
444
- throw new RuntimeException (e );
445
- }
430
+ String url = "https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo?"
431
+ + "code=" + code
432
+ + "&agendid=" + wxCpConfigStorage .getAgentId ();
433
+ String responseText = get (url , null );
434
+ JsonElement je = Streams .parse (new JsonReader (new StringReader (responseText )));
435
+ JsonObject jo = je .getAsJsonObject ();
436
+ return new String [] {GsonHelper .getString (jo , "UserId" ), GsonHelper .getString (jo , "DeviceId" )};
446
437
}
447
438
448
439
@ Override
0 commit comments