Commit 97b59ab1 authored by shangtx's avatar shangtx

feat: 小程序登录暂不获取unionid

parent 502cf394
...@@ -42,7 +42,7 @@ wx: ...@@ -42,7 +42,7 @@ wx:
# secret: d5e1aeae4fa4daa6328a6a02ddafb9ff #公众号的appsecret # secret: d5e1aeae4fa4daa6328a6a02ddafb9ff #公众号的appsecret
# 微信支付 # 微信支付
pay: pay:
appId: wxa56f0845ca456bac #微信公众号或者小程序等的appid appId: wxf4a024bdaacf6d70 #微信公众号或者小程序等的appid
mchId: 1602411974 #微信支付商户号 mchId: 1602411974 #微信支付商户号
# 公众号 # 公众号
### ###
......
...@@ -67,9 +67,9 @@ public class WeiXinService { ...@@ -67,9 +67,9 @@ public class WeiXinService {
return fail("微信用户信息校验失败"); return fail("微信用户信息校验失败");
} }
if (StringUtils.isBlank(unionId)) { /* if (StringUtils.isBlank(unionId)) {
return fail("unionId无法获取,登录失败"); return fail("unionId无法获取,登录失败");
} }*/
// 解密用户信息 // 解密用户信息
WxMaUserInfo userInfo = wxMaService.getUserService().getUserInfo( WxMaUserInfo userInfo = wxMaService.getUserService().getUserInfo(
sessionKey, loginDTO.getEncryptedData(), loginDTO.getIv()); sessionKey, loginDTO.getEncryptedData(), loginDTO.getIv());
...@@ -77,7 +77,7 @@ public class WeiXinService { ...@@ -77,7 +77,7 @@ public class WeiXinService {
String avatarUrl = userInfo.getAvatarUrl(); String avatarUrl = userInfo.getAvatarUrl();
// 是否存在用户 // 是否存在用户
Optional<User> hasUser = Optional.ofNullable(userService.selectOneByProperty("unionId", unionId)); Optional<User> hasUser = Optional.ofNullable(userService.selectOneByProperty("openId", openId));
if (hasUser.isPresent()) { if (hasUser.isPresent()) {
User user = hasUser.get(); User user = hasUser.get();
user.setNickName(nickName); user.setNickName(nickName);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment