mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-24 07:19:46 +08:00
fix 修复多租户下注册用户BUG
This commit is contained in:
@ -33,6 +33,13 @@ public interface ISysConfigService {
|
||||
*/
|
||||
String selectConfigByKey(String configKey);
|
||||
|
||||
/**
|
||||
* 获取注册开关
|
||||
* @param tenantId 租户id
|
||||
* @return true开启,false关闭
|
||||
*/
|
||||
boolean selectRegisterEnabled(String tenantId);
|
||||
|
||||
/**
|
||||
* 获取验证码开关
|
||||
*
|
||||
|
@ -16,6 +16,7 @@ import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.ruoyi.common.mybatis.core.page.PageQuery;
|
||||
import com.ruoyi.common.mybatis.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.redis.utils.CacheUtils;
|
||||
import com.ruoyi.common.tenant.helper.TenantHelper;
|
||||
import com.ruoyi.system.domain.SysConfig;
|
||||
import com.ruoyi.system.domain.bo.SysConfigBo;
|
||||
import com.ruoyi.system.domain.vo.SysConfigVo;
|
||||
@ -77,6 +78,22 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取注册开关
|
||||
* @param tenantId 租户id
|
||||
* @return true开启,false关闭
|
||||
*/
|
||||
@Override
|
||||
public boolean selectRegisterEnabled(String tenantId) {
|
||||
SysConfig retConfig = baseMapper.selectOne(new LambdaQueryWrapper<SysConfig>()
|
||||
.eq(SysConfig::getConfigKey, "sys.account.registerUser")
|
||||
.eq(TenantHelper.isEnable(),SysConfig::getTenantId, tenantId));
|
||||
if (ObjectUtil.isNull(retConfig)) {
|
||||
return false;
|
||||
}
|
||||
return Convert.toBool(retConfig.getConfigValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取验证码开关
|
||||
*
|
||||
|
Reference in New Issue
Block a user