yujian
2019-05-14 ad9fbd2c18f280ef9bba47f28353d367cf2d94e8
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserAccountServiceImpl.java
@@ -677,6 +677,14 @@
         updateUserInfo.setNickName(Constant.systemCommonConfig.getDefaultNickName() + user.getId());
         userInfoMapper.updateByPrimaryKeySelective(updateUserInfo);
      }
      try {
         // 第一次登录时创建用户额外信息
         userInfoExtraService.createUserInfoExtra(user.getId());
      } catch (Exception e) {
         e.printStackTrace();
      }
   }
   @Override
@@ -917,7 +925,7 @@
      phone = phone.replaceAll(" ", "");
      // 苹果应用商店上线测试号码
      if ("17316780233".equalsIgnoreCase(phone) && "258168".equalsIgnoreCase(vcode)) {
      if ("17316780233".equalsIgnoreCase(phone) && "2581".equalsIgnoreCase(vcode)) {
         ;
      } else {
@@ -1102,18 +1110,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, "该帐号没有绑定手机号码,需绑定手机号码才能完成微信更换");
      }