| | |
| | | package com.qxueyou.scc.wx.service.impl; |
| | | |
| | | import cn.hutool.http.HttpUtil; |
| | | import com.alibaba.druid.util.HttpClientUtils; |
| | | import com.alibaba.druid.util.StringUtils; |
| | | import com.alibaba.fastjson.JSON; |
| | |
| | | |
| | | return s; |
| | | } |
| | | @Override |
| | | public JSONObject getUser(String token, String openId) { |
| | | String requestUrl = "https://api.weixin.qq.com/sns/userinfo"; |
| | | |
| | | Map<String, String> requestUrlParam = new HashMap<>(); |
| | | |
| | | requestUrlParam.put("access_token", token); |
| | | |
| | | requestUrlParam.put("openid", openId); |
| | | |
| | | requestUrlParam.put("lang", "zh_CN"); |
| | | |
| | | JSONObject s = JSON.parseObject(HttpClientUtil.doGet(requestUrl, requestUrlParam)); |
| | | |
| | | return s; |
| | | } |
| | | // private String getWechatHeadImgUrl(String unionId) { |
| | | // WechatUserDO wxUser = this.template.findOne(Query.query(condition().and("unionId").is(unionId)), WechatUserDO.class); |
| | | // return wxUser.getHeadImgUrl(); |