重要代码
前台微信小程序支付部分:
/**
* 微信用户登录
* @return
*/
@RequestMapping("/wxlogin")
public Map<String,Object> wxLogin(@RequestBody User user) {
// GET https://api.weixin.qq.com/sns/jscode2session?appid=APPID&secret=SECRET&js_code=JSCODE&grant_type=authorization_code
String jscode2sessionUrl=weixinProperties.getJscode2sessionUrl()+"?appid="+weixinProperties.getAppid()+"&secret="+weixinProperties.getSecret()+ "&js_code="+user.getCode()+"&grant_type=authorization_code";
System.out.println(jscode2sessionUrl);
String result = httpClientUtil.sendHttpGet(jscode2sessionUrl);
System.out.println(result);
JSONObject jsonObject= JSON.parseObject(result);
String openid = jsonObject.get("ope