wx login
This commit is contained in:
parent
a07b3675dc
commit
d799293b5c
|
|
@ -45,7 +45,8 @@ public class WxController extends BaseController {
|
||||||
|
|
||||||
@GetMapping("/auth")
|
@GetMapping("/auth")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult auth(String code) {
|
public AjaxResult auth(HttpServletRequest request) {
|
||||||
|
String code = request.getHeader("code");
|
||||||
String url = "https://api.weixin.qq.com/sns/jscode2session?appid=" + wxConfig.getAppId() + "&secret=" + wxConfig.getSecret() + "&js_code=" + code + "&grant_type=authorization_code";
|
String url = "https://api.weixin.qq.com/sns/jscode2session?appid=" + wxConfig.getAppId() + "&secret=" + wxConfig.getSecret() + "&js_code=" + code + "&grant_type=authorization_code";
|
||||||
String data = HttpUtils.sendGet(url, null);
|
String data = HttpUtils.sendGet(url, null);
|
||||||
JSONObject result = JSONObject.parseObject(data);
|
JSONObject result = JSONObject.parseObject(data);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue