码迷,mamicode.com
首页 > 其他好文 > 详细

杂项:20190624

时间:2019-06-24 16:20:54      阅读:88      评论:0      收藏:0      [点我收藏+]

标签:lsp   alibaba   否则   home   res   http   span   class   public   

ylbtech-杂项:20190624

 

1.返回顶部
1.1
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;
1.2
public static String getTemplateMessageSend(RestTemplate restTemplate) {

String accessTokenUrl = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential";
String appID = "wx";
String secret = "90f";

String path = String.format("%s&appid=%s&secret=%s", accessTokenUrl, appID, secret);
ResponseEntity<String> entity = restTemplate.getForEntity(path, String.class);
JSONObject responseObj = JSON.parseObject(entity.getBody());
String access_token = responseObj.getString("access_token");

return access_token;
}
1.3
2.返回顶部
 
3.返回顶部
 
4.返回顶部
 
5.返回顶部
 
 
6.返回顶部
 
技术图片 作者:ylbtech
出处:http://ylbtech.cnblogs.com/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

杂项:20190624

标签:lsp   alibaba   否则   home   res   http   span   class   public   

原文地址:https://www.cnblogs.com/storebook/p/11077260.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!