fix(订单中心):租户模式开启后,存在tenantId=null的问题,如果=null则默认使用webApp

This commit is contained in:
2025-07-30 07:48:26 +08:00
parent 7792b46e51
commit a6ff56291d
4 changed files with 30 additions and 13 deletions
@@ -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,使用默认租户");
}
@@ -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;
}