From 37794b5738639e60c8fdb6a196fc13d682d732d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Thu, 2 Mar 2023 10:32:04 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=20=E5=A4=9A=E7=A7=9F?= =?UTF-8?q?=E6=88=B7=E7=9B=B8=E5=90=8C=E8=B4=A6=E5=8F=B7=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/web/service/SysLoginService.java | 6 +++++ .../ruoyi/system/mapper/SysUserMapper.java | 23 ++++++++++++++++++- .../resources/mapper/system/SysUserMapper.xml | 10 ++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/service/SysLoginService.java b/ruoyi-admin/src/main/java/com/ruoyi/web/service/SysLoginService.java index fe3af8e6..c8357cc5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/service/SysLoginService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/service/SysLoginService.java @@ -216,6 +216,9 @@ public class SysLoginService { log.info("登录用户:{} 已被停用.", username); throw new UserException("user.blocked", username); } + if (TenantHelper.isEnable()) { + return userMapper.selectTenantUserByUserName(username, tenantId); + } return userMapper.selectUserByUserName(username); } @@ -231,6 +234,9 @@ public class SysLoginService { log.info("登录用户:{} 已被停用.", phonenumber); throw new UserException("user.blocked", phonenumber); } + if (TenantHelper.isEnable()) { + return userMapper.selectTenantUserByPhonenumber(phonenumber, tenantId); + } return userMapper.selectUserByPhonenumber(phonenumber); } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java index 9ea77623..8fe41485 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java @@ -1,12 +1,13 @@ package com.ruoyi.system.mapper; +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.toolkit.Constants; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.common.mybatis.annotation.DataColumn; import com.ruoyi.common.mybatis.annotation.DataPermission; -import com.ruoyi.system.domain.SysUser; import com.ruoyi.common.mybatis.core.mapper.BaseMapperPlus; +import com.ruoyi.system.domain.SysUser; import com.ruoyi.system.domain.vo.SysUserVo; import org.apache.ibatis.annotations.Param; @@ -77,6 +78,26 @@ public interface SysUserMapper extends BaseMapperPlus + + + +