|
|
@@ -37,7 +37,7 @@ import static com.usoftchina.smartschool.school.wxschool.utils.ResultBean.ErrorC
|
|
|
@RestController
|
|
|
@RequestMapping("/wxSchool/user")
|
|
|
public class WxUserController {
|
|
|
- private static final Logger log = LoggerFactory.getLogger(WxUserController.class);
|
|
|
+// private static final Logger log = LoggerFactory.getLogger(WxUserController.class);
|
|
|
|
|
|
@Autowired
|
|
|
private WxUserService userService;
|
|
|
@@ -128,11 +128,11 @@ public class WxUserController {
|
|
|
params.put("grant_type", "authorization_code");
|
|
|
HttpRequest response= HttpRequest.get("https://api.weixin.qq.com/sns/oauth2/access_token", params, true);
|
|
|
String result=response.body();
|
|
|
- log.info("result======"+result);
|
|
|
+ System.err.println("result======"+result);
|
|
|
String openid= JSON.parseObject(result).getString("openid");
|
|
|
- log.info("openid======="+openid);
|
|
|
+ System.err.println("openid======="+openid);
|
|
|
String token= JSON.parseObject(result).getString("access_token");
|
|
|
- log.info("token====="+token);
|
|
|
+ System.err.println("token====="+token);
|
|
|
HashMap<String, Object> param=new HashMap<>();
|
|
|
param.put("openid",openid);
|
|
|
param.put("access_token",token);
|
|
|
@@ -140,10 +140,10 @@ public class WxUserController {
|
|
|
HttpRequest res= HttpRequest.get("https://api.weixin.qq.com/sns/userinfo", param, true);
|
|
|
//HttpRequest res= HttpRequest.get("https://api.weixin.qq.com/cgi-bin/user/info", param, true);
|
|
|
String body = res.body();
|
|
|
- log.info("res======"+res);
|
|
|
- log.info("body======"+body);
|
|
|
+ System.err.println("res======"+res);
|
|
|
+ System.err.println("body======"+body);
|
|
|
String headimgurl = JSON.parseObject(result).getString("headimgurl");
|
|
|
- log.info("headimgurl======"+headimgurl);
|
|
|
+ System.err.println("headimgurl======"+headimgurl);
|
|
|
return new ModelAndView("redirect:https://school-wechat.ubtob.com/bindMenu/open/"+openid+"/headimgurl/"+headimgurl);
|
|
|
}
|
|
|
|