杂项:20190624

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.返回顶部
 
warn 作者:ylbtech
出处:http://ylbtech.cnblogs.com/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
原文地址:https://www.cnblogs.com/storebook/p/11077260.html