| | |
| | | import cn.lili.common.security.context.UserContext; |
| | | import cn.lili.common.security.token.Token; |
| | | import cn.lili.common.utils.HttpUtils; |
| | | import cn.lili.common.utils.StringUtils; |
| | | import cn.lili.common.utils.UuidUtils; |
| | | import cn.lili.modules.connect.entity.Connect; |
| | | import cn.lili.modules.connect.entity.dto.AuthToken; |
| | |
| | | Map<String, String> map = new HashMap<>(3); |
| | | //得到微信小程序联合登陆信息 |
| | | JSONObject json = this.getConnect(params.getCode()); |
| | | System.out.println(json); |
| | | //存储session key 后续登录用得到 |
| | | String sessionKey = json.getStr("session_key"); |
| | | String unionId = json.getStr("unionid"); |
| | |
| | | map.put("sessionKey", sessionKey); |
| | | map.put("unionId", unionId); |
| | | map.put("openId", openId); |
| | | |
| | | System.out.println(sessionKey); |
| | | //微信联合登陆参数 |
| | | return phoneMpBindAndLogin(map.get("sessionKey"), params, map.get("openId"), map.get("unionId")); |
| | | } |
| | |
| | | //如果未绑定会员,则把刚才查询到的联合登录表数据删除 |
| | | if (member == null) { |
| | | this.remove(queryWrapper); |
| | | |
| | | member = memberService.autoRegister(authUser,encryptTwice); |
| | | } |
| | | } |
| | | }else { |
| | | if (StringUtils.isBlank(member.getMobile())) { |
| | | member.setMobile(authUser.getPhone()); |
| | | memberService.updateById(member); |
| | | } |
| | | } |
| | | |
| | | //发送用户第三方登录消息 |