admin
2020-07-03 651a15c78f668bef3859d9ed1bb7ad0b669d3600
fanli/src/main/java/com/yeshi/fanli/service/impl/user/wx/WXMPUserLoginServiceImpl.java
@@ -2,6 +2,8 @@
import javax.annotation.Resource;
import com.yeshi.fanli.entity.SystemEnum;
import com.yeshi.fanli.util.SystemInfoUtil;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -42,12 +44,13 @@
   @Transactional(rollbackFor = Exception.class)
   @Override
   public WXMPLoginResult wxmpLogin(WXMPLoginData loginData) throws UserAccountException {
        SystemEnum system = SystemInfoUtil.getSystemByWXCXCAppId(loginData.getAppId());
      if (!StringUtil.isNullOrEmpty(loginData.getPhone())) {// 电话号码登录
         ForbiddenUserIdentifyCode identifyCode1 = forbiddenUserIdentifyCodeService
               .listByTypeAndIdentifyCode(ForbiddenUserIdentifyCodeTypeEnum.phone, loginData.getPhone());
         if (identifyCode1 != null && identifyCode1.getEffective() != null && identifyCode1.getEffective())
            throw new UserAccountException(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC);
         if (loginData.getLastUser() != null) {// 电话号码绑定
            if (loginData.getLastUser().getId() != null) {// 绑定
@@ -92,7 +95,7 @@
            }
         } else {// 登录
            UserInfo userInfo = userAccountService.getUserInfoByPhone(loginData.getAppId(), loginData.getPhone());
                UserInfo userInfo = userAccountService.getUserInfoByPhone(SystemInfoUtil.getSystemByWXCXCAppId(loginData.getAppId()), loginData.getPhone());
            if (userInfo != null) {// 已存在的用户
               String inviteCode = userInfoExtraService.getInviteCodeByUid(userInfo.getId());
               if (StringUtil.isNullOrEmpty(inviteCode)) {// 需要绑定邀请码
@@ -133,7 +136,7 @@
               ForbiddenUserIdentifyCodeTypeEnum.wxUnionId, loginData.getWxUser().getUnionId());
         if (identifyCode1 != null && identifyCode1.getEffective() != null && identifyCode1.getEffective())
            throw new UserAccountException(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC);
         UserInfo userInfo = userAccountService.getUserInfoByWXUnionId(loginData.getAppId(),
            UserInfo userInfo = userAccountService.getUserInfoByWXUnionId(system,
               loginData.getWxUser().getUnionId());
         if (userInfo != null) {// 已存在的用户
            // 是否绑定了电话