From 690361e16f3550cb659701fb30eea5a336292402 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期五, 19 四月 2019 18:17:02 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserAccountServiceImpl.java | 23 ++++++++++++++--------- 1 files changed, 14 insertions(+), 9 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserAccountServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserAccountServiceImpl.java index 6c432ea..f32a7de 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserAccountServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserAccountServiceImpl.java @@ -1102,18 +1102,23 @@ if (weiXinUser == null) { throw new UserAccountException(2, "寰俊甯愬彿鎺堟潈澶辫触"); } - - if (weiXinUser.getUnionid().equalsIgnoreCase(user.getWxUnionId())) { + + String wxUnionId = weiXinUser.getUnionid(); + if (StringUtil.isNullOrEmpty(wxUnionId)) { + throw new UserAccountException(2, "寰俊甯愬彿鎺堟潈澶辫触"); + } + + String wxUnionIdExist = user.getWxUnionId(); + if (StringUtil.isNullOrEmpty(wxUnionIdExist)) { + UserInfo newUser = userInfoMapper.getEffectiveUserInfoByWXUnionId(wxUnionId); + if (newUser != null) { + throw new UserAccountException(4, "璇ュ井淇″彿宸茶鍏朵粬甯愬彿缁戝畾"); + } + } else if (wxUnionId.equals(wxUnionIdExist)) { throw new UserAccountException(3, "寰俊甯愬彿涓�鑷存棤闇�鏇存崲"); } - UserInfo newUser = userInfoMapper.getEffectiveUserInfoByWXUnionId(weiXinUser.getUnionid()); - if (newUser != null) { - throw new UserAccountException(4, "璇ュ井淇″彿宸茶鍏朵粬甯愬彿缁戝畾"); - } - - String wxUnionId = user.getWxUnionId(); - if (!StringUtil.isNullOrEmpty(wxUnionId) && StringUtil.isNullOrEmpty(user.getPhone())) { + if (StringUtil.isNullOrEmpty(user.getPhone())) { throw new UserAccountException(5, "璇ュ笎鍙锋病鏈夌粦瀹氭墜鏈哄彿鐮侊紝闇�缁戝畾鎵嬫満鍙风爜鎵嶈兘瀹屾垚寰俊鏇存崲"); } -- Gitblit v1.8.0