update 优化 RedisUtils 支持忽略租户

2.X
疯狂的狮子Li 10 months ago
parent a44acba68f
commit d08c76cbdd

@ -1,5 +1,6 @@
package org.dromara.common.tenant.handle;
import com.baomidou.mybatisplus.core.plugins.InterceptorIgnoreHelper;
import lombok.extern.slf4j.Slf4j;
import org.dromara.common.core.constant.GlobalConstants;
import org.dromara.common.core.utils.StringUtils;
@ -26,6 +27,9 @@ public class TenantKeyPrefixHandler extends KeyPrefixHandler {
if (StringUtils.isBlank(name)) {
return null;
}
if (InterceptorIgnoreHelper.willIgnoreTenantLine("")) {
return super.map(name);
}
if (StringUtils.contains(name, GlobalConstants.GLOBAL_REDIS_KEY)) {
return super.map(name);
}
@ -49,6 +53,9 @@ public class TenantKeyPrefixHandler extends KeyPrefixHandler {
if (StringUtils.isBlank(unmap)) {
return null;
}
if (InterceptorIgnoreHelper.willIgnoreTenantLine("")) {
return super.unmap(name);
}
if (StringUtils.contains(name, GlobalConstants.GLOBAL_REDIS_KEY)) {
return super.unmap(name);
}

Loading…
Cancel
Save