liukangdong
2025-01-07 f9c24ba3d5eba45afef222dcd72b6383893efc76
server/system_service/src/main/java/com/doumee/service/system/impl/SystemLoginServiceImpl.java
@@ -403,19 +403,19 @@
            throw new BusinessException(ResponseStatus.ACCOUNT_INCORRECT);
        }
        //注册司机
        if((Constants.equalsInteger(user.getType(),Constants.ZERO)
        if(!((Constants.equalsInteger(user.getType(),Constants.ZERO)
                ||Constants.equalsInteger(user.getType(),Constants.TWO))
                && Objects.nonNull(user.getMemberId())){
            if(Constants.equalsInteger(user.getType(),Constants.TWO)){
                if(Objects.isNull(user.getCompanyId())){
                    throw new BusinessException(ResponseStatus.NO_ALLOW_LOGIN);
                }
                Company company = companyMapper.selectById(user.getCompanyId());
                if(Objects.isNull(company) || Constants.equalsInteger(company.getType(),Constants.ONE)){
                    throw new BusinessException(ResponseStatus.NO_ALLOW_LOGIN);
                }
            }
        }else{
                && Objects.nonNull(user.getMemberId()))){
//            if(Constants.equalsInteger(user.getType(),Constants.TWO)){
//                if(Objects.isNull(user.getCompanyId())){
//                    throw new BusinessException(ResponseStatus.NO_ALLOW_LOGIN);
//                }
//                Company company = companyMapper.selectById(user.getCompanyId());
//                if(Objects.isNull(company) || Constants.equalsInteger(company.getType(),Constants.ONE)){
//                    throw new BusinessException(ResponseStatus.NO_ALLOW_LOGIN);
//                }
//            }
//        }else{
            throw new BusinessException(ResponseStatus.NO_ALLOW_LOGIN);
        }
        if(StringUtils.isNotBlank(password)){
@@ -473,7 +473,7 @@
        if (systemUser == null) {
            systemUser = autoRegisterUser(Constants.memberType.driver,param.getPhone(),param.getOpenid(),true);
        }else{
            if(!Constants.equalsInteger(systemUser.getType(),Constants.memberType.driver)){
            if(!(Constants.equalsInteger(systemUser.getType(),Constants.memberType.driver)||Constants.equalsInteger(systemUser.getType(),Constants.memberType.internal))){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,请使用正确的司机账号登陆!");
            }
        }