Commit a900e14b authored by 王亮's avatar 王亮

fix some issues.

parent 6f54c95e
...@@ -31,7 +31,7 @@ public class WechatBindingEventListener implements ApplicationListener<UserLogin ...@@ -31,7 +31,7 @@ public class WechatBindingEventListener implements ApplicationListener<UserLogin
public void onApplicationEvent(UserLoginEvent userLoginEvent) { public void onApplicationEvent(UserLoginEvent userLoginEvent) {
if (userLoginEvent.getUserTag() != null) { if (userLoginEvent.getUserTag() != null) {
User user = userRepository.findByIdAndTenantId(userLoginEvent.getUserTag().getUserId(), userLoginEvent.getUserTag().getTenantId()); User user = userRepository.findByIdAndTenantId(userLoginEvent.getUserTag().getUserId(), userLoginEvent.getUserTag().getTenantId());
if (StringUtils.isNotEmpty(user.getPhoneNo())) { if (user != null && StringUtils.isNotEmpty(user.getPhoneNo())) {
List<WechatUserInfo> wechatUserInfoList = weChatUserRepository.findByPhoneNoAndTenantId(user.getPhoneNo(), user.getTenantId()); List<WechatUserInfo> wechatUserInfoList = weChatUserRepository.findByPhoneNoAndTenantId(user.getPhoneNo(), user.getTenantId());
wechatUserInfoList.forEach(i -> i.setUserId(user.getId())); wechatUserInfoList.forEach(i -> i.setUserId(user.getId()));
weChatUserRepository.save(wechatUserInfoList); weChatUserRepository.save(wechatUserInfoList);
......
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