| | |
| | | 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, "该帐号没有绑定手机号码,需绑定手机号码才能完成微信更换");
|
| | | }
|
| | |
|