|
1 | 1 | package me.chanjar.weixin.cp.api; |
2 | 2 |
|
3 | | -import java.io.File; |
4 | | -import java.io.IOException; |
5 | | -import java.io.InputStream; |
6 | | -import java.util.List; |
7 | | -import java.util.UUID; |
8 | | - |
9 | | -import org.apache.http.HttpHost; |
10 | | -import org.apache.http.client.ClientProtocolException; |
11 | | -import org.apache.http.client.config.RequestConfig; |
12 | | -import org.apache.http.client.methods.CloseableHttpResponse; |
13 | | -import org.apache.http.client.methods.HttpGet; |
14 | | -import org.apache.http.impl.client.BasicResponseHandler; |
15 | | -import org.apache.http.impl.client.CloseableHttpClient; |
16 | | -import org.slf4j.Logger; |
17 | | -import org.slf4j.LoggerFactory; |
18 | | - |
19 | | -import com.google.gson.JsonArray; |
20 | | -import com.google.gson.JsonElement; |
21 | | -import com.google.gson.JsonObject; |
22 | | -import com.google.gson.JsonParser; |
23 | | -import com.google.gson.JsonPrimitive; |
| 3 | +import com.google.gson.*; |
24 | 4 | import com.google.gson.reflect.TypeToken; |
25 | | - |
26 | 5 | import me.chanjar.weixin.common.bean.WxAccessToken; |
27 | 6 | import me.chanjar.weixin.common.bean.WxJsapiSignature; |
28 | 7 | import me.chanjar.weixin.common.bean.menu.WxMenu; |
|
36 | 15 | import me.chanjar.weixin.common.util.StringUtils; |
37 | 16 | import me.chanjar.weixin.common.util.crypto.SHA1; |
38 | 17 | import me.chanjar.weixin.common.util.fs.FileUtils; |
39 | | -import me.chanjar.weixin.common.util.http.ApacheHttpClientBuilder; |
40 | | -import me.chanjar.weixin.common.util.http.DefaultApacheHttpClientBuilder; |
41 | | -import me.chanjar.weixin.common.util.http.MediaDownloadRequestExecutor; |
42 | | -import me.chanjar.weixin.common.util.http.MediaUploadRequestExecutor; |
43 | | -import me.chanjar.weixin.common.util.http.RequestExecutor; |
44 | | -import me.chanjar.weixin.common.util.http.SimpleGetRequestExecutor; |
45 | | -import me.chanjar.weixin.common.util.http.SimplePostRequestExecutor; |
46 | | -import me.chanjar.weixin.common.util.http.URIUtil; |
| 18 | +import me.chanjar.weixin.common.util.http.*; |
47 | 19 | import me.chanjar.weixin.common.util.json.GsonHelper; |
48 | 20 | import me.chanjar.weixin.cp.bean.WxCpDepart; |
49 | 21 | import me.chanjar.weixin.cp.bean.WxCpMessage; |
50 | 22 | import me.chanjar.weixin.cp.bean.WxCpTag; |
51 | 23 | import me.chanjar.weixin.cp.bean.WxCpUser; |
52 | 24 | import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; |
| 25 | +import org.apache.http.HttpHost; |
| 26 | +import org.apache.http.client.ClientProtocolException; |
| 27 | +import org.apache.http.client.config.RequestConfig; |
| 28 | +import org.apache.http.client.methods.CloseableHttpResponse; |
| 29 | +import org.apache.http.client.methods.HttpGet; |
| 30 | +import org.apache.http.impl.client.BasicResponseHandler; |
| 31 | +import org.apache.http.impl.client.CloseableHttpClient; |
| 32 | +import org.slf4j.Logger; |
| 33 | +import org.slf4j.LoggerFactory; |
| 34 | + |
| 35 | +import java.io.File; |
| 36 | +import java.io.IOException; |
| 37 | +import java.io.InputStream; |
| 38 | +import java.util.List; |
| 39 | +import java.util.UUID; |
53 | 40 |
|
54 | 41 | public class WxCpServiceImpl implements WxCpService { |
55 | 42 |
|
@@ -185,10 +172,10 @@ public WxJsapiSignature createJsapiSignature(String url) throws WxErrorException |
185 | 172 | jsapiSignature.setNoncestr(noncestr); |
186 | 173 | jsapiSignature.setUrl(url); |
187 | 174 | jsapiSignature.setSignature(signature); |
188 | | - |
| 175 | + |
189 | 176 | // Fixed bug |
190 | 177 | jsapiSignature.setAppid(this.configStorage.getCorpId()); |
191 | | - |
| 178 | + |
192 | 179 | return jsapiSignature; |
193 | 180 | } |
194 | 181 |
|
@@ -503,7 +490,7 @@ public String[] oauth2getUserInfo(String code) throws WxErrorException { |
503 | 490 | public String[] oauth2getUserInfo(String agentId, String code) throws WxErrorException { |
504 | 491 | String url = "https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo?" |
505 | 492 | + "code=" + code |
506 | | - + "&agendid=" + agentId; |
| 493 | + + "&agentid=" + agentId; |
507 | 494 | String responseText = get(url, null); |
508 | 495 | JsonElement je = new JsonParser().parse(responseText); |
509 | 496 | JsonObject jo = je.getAsJsonObject(); |
|
0 commit comments