fix(订单中心):租户模式开启后,存在tenantId=null的问题,如果=null则默认使用webApp
This commit is contained in:
+2
-1
@@ -37,10 +37,11 @@ public class TenantFilter extends OncePerRequestFilter {
|
||||
log.debug("请求URL: {}, 租户ID: {}", request.getRequestURI(), tenantId);
|
||||
|
||||
//保存租户id
|
||||
if (StrUtil.isNotEmpty(tenantId)) {
|
||||
if (StrUtil.isNotEmpty(tenantId) && null != tenantId) {
|
||||
TenantContextHolder.setTenant(tenantId);
|
||||
log.debug("设置租户上下文: {}", tenantId);
|
||||
} else {
|
||||
TenantContextHolder.setTenant("webApp");
|
||||
log.debug("未找到租户ID,使用默认租户");
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -49,7 +49,8 @@ public class CustomTenantInterceptor extends TenantLineInnerInterceptor {
|
||||
}
|
||||
|
||||
// 租户为null时跳过租户过滤
|
||||
if (null == tenant) {
|
||||
log.debug("租户ID: {}", tenant);
|
||||
if (null == tenant ) {
|
||||
log.debug("租户为null,SQL {} 跳过租户过滤", msId);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user