张延森 3 years ago
parent
commit
5328114c73

+ 1
- 1
pom.xml View File

10
 	</parent>
10
 	</parent>
11
 	<groupId>com.yunzhi</groupId>
11
 	<groupId>com.yunzhi</groupId>
12
 	<artifactId>gnyy</artifactId>
12
 	<artifactId>gnyy</artifactId>
13
-	<version>0.0.1</version>
13
+	<version>0.0.3</version>
14
 	<name>qrcode</name>
14
 	<name>qrcode</name>
15
 	<description>Demo project for Spring Boot</description>
15
 	<description>Demo project for Spring Boot</description>
16
 
16
 

+ 2
- 2
src/main/java/com/yunzhi/gnyy/common/HttpUtils.java View File

13
 @Component
13
 @Component
14
 public class HttpUtils {
14
 public class HttpUtils {
15
     public String get(String url) throws Exception {
15
     public String get(String url) throws Exception {
16
-        log.info("请求地址: ", url);
16
+        log.info("请求地址: {}", url);
17
         RestTemplate restTemplate = new RestTemplate();
17
         RestTemplate restTemplate = new RestTemplate();
18
         HttpHeaders headers = new HttpHeaders();
18
         HttpHeaders headers = new HttpHeaders();
19
         headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON));
19
         headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON));
25
 
25
 
26
         ResponseEntity<String> resp = restTemplate.exchange(formatURL, HttpMethod.GET, entity, String.class, params);
26
         ResponseEntity<String> resp = restTemplate.exchange(formatURL, HttpMethod.GET, entity, String.class, params);
27
         String res = resp.getBody();
27
         String res = resp.getBody();
28
-        log.info("请求结果: ", res);
28
+        log.info("请求结果: {}", res);
29
         return res;
29
         return res;
30
     }
30
     }
31
 
31
 

+ 5
- 0
src/main/java/com/yunzhi/gnyy/common/WxUtils.java View File

50
         conf.setAesKey(miniapp.getAesKey());
50
         conf.setAesKey(miniapp.getAesKey());
51
         conf.setMsgDataFormat("JSON");
51
         conf.setMsgDataFormat("JSON");
52
 
52
 
53
+        if (null != miniapp.getHttpProxyHost() && !"".equals(miniapp.getHttpProxyHost())) {
54
+            conf.setHttpProxyHost(miniapp.getHttpProxyHost());
55
+            conf.setHttpProxyPort(miniapp.getHttpProxyPort());
56
+        }
57
+
53
         WxMaService service = new WxMaServiceImpl();
58
         WxMaService service = new WxMaServiceImpl();
54
         service.setWxMaConfig(conf);
59
         service.setWxMaConfig(conf);
55
         return service;
60
         return service;

+ 2
- 0
src/main/java/com/yunzhi/gnyy/config/WeixinConfig.java View File

23
         private String token;
23
         private String token;
24
         private String aesKey;
24
         private String aesKey;
25
         private String msgDataFormat;
25
         private String msgDataFormat;
26
+        private String httpProxyHost;
27
+        private Integer httpProxyPort;
26
     }
28
     }
27
 
29
 
28
 //    @Data
30
 //    @Data

+ 4
- 2
src/main/resources/application.yml View File

33
 ###
33
 ###
34
 weixin:
34
 weixin:
35
   miniapp:
35
   miniapp:
36
-    appid: wx835627a9b9b3932a
37
-    secret: 51cc2b26c1628ae098f05a3ba8e6f6f4
36
+    appid: wx9a218cc3471fe233
37
+    secret: 79a93850c4168c848e663ba7cbd1dfb9
38
     token:
38
     token:
39
     aesKey:
39
     aesKey:
40
     msgDataFormat: JSON
40
     msgDataFormat: JSON
41
+    httpProxyHost:
42
+    httpProxyPort:
41
 
43
 
42
 ###
44
 ###
43
 spring:
45
 spring: