|
|
@@ -37,11 +37,19 @@ public class WechatLogOnServiceImpl implements WechatLogOnService {
|
|
37
|
37
|
System.out.println("微信返回数据"+a);
|
|
38
|
38
|
String openid =(String)JSONObject.parseObject(a).get("openid");
|
|
39
|
39
|
String unionid =(String)JSONObject.parseObject(a).get("unionid");
|
|
|
40
|
+ String access_token =(String)JSONObject.parseObject(a).get("access_token");
|
|
|
41
|
+ String url2 = SystemConfig.WECHAT_USER_INFO_URL.replace("ACCESS_TOKEN", access_token).replace("OPENID", openid);
|
|
|
42
|
+ String b = HttpURLConnectionUtils.doGet(url2);
|
|
|
43
|
+ System.out.println("微信返回数据"+b);
|
|
|
44
|
+ String nickname =(String)JSONObject.parseObject(b).get("nickname");
|
|
|
45
|
+ String headimgurl =(String)JSONObject.parseObject(b).get("headimgurl");
|
|
40
|
46
|
/**
|
|
41
|
47
|
* 拿openid 查询数据库 判断用户是否绑定 绑定成功直接登录进入系统,绑定不成功返回标示 提示用户进行绑定
|
|
42
|
48
|
*/
|
|
43
|
49
|
// User user = userDao.selectUserByOpenid(openid);
|
|
44
|
50
|
User user = userDao.selectUserByOpenid(unionid);
|
|
|
51
|
+ data.put("nickname",nickname);
|
|
|
52
|
+ data.put("headimgurl",headimgurl);
|
|
45
|
53
|
data.put("openid",openid);
|
|
46
|
54
|
data.put("unionid",unionid);
|
|
47
|
55
|
if(user==null){
|