Просмотр исходного кода

!1837 解决BUG:由于之前的提交里BuildOrder增强了对SQL注入的处理,原生成模板中,对于关联表排序时默认使用 u.CreateTime …
Merge pull request !1837 from hwjmyz/v2-20250625

zuohuaijun 1 год назад
Родитель
Сommit
f1232f4078

+ 1 - 1
Admin.NET/Admin.NET.Core/SqlSugar/SqlSugarSetup.cs

@@ -455,7 +455,7 @@ public static class SqlSugarSetup
             case SqlSugarConst.MainConfigId:
                 return entityType.GetCustomAttributes<SysTableAttribute>().Any() ||
                        (!entityType.GetCustomAttributes<LogTableAttribute>().Any() &&
-                        !entityType.GetCustomAttributes<TenantAttribute>().Any());
+                        !entityType.GetCustomAttributes<TenantAttribute>().Any(o => o.configId.ToString() != config.ConfigId.ToString()));
 
             case SqlSugarConst.LogConfigId:
                 return entityType.GetCustomAttributes<LogTableAttribute>().Any();

+ 1 - 1
Admin.NET/Admin.NET.Web.Entry/wwwroot/template/index.vue.vm

@@ -40,7 +40,7 @@ const state = reactive({
     page: 1,
     pageSize: 20,
     total: 0,
-    field: '@(Model.HasJoinTable ? "u.createTime" : "createTime")', // 默认的排序字段
+    field: 'createTime', // 默认的排序字段
     order: 'descending', // 排序方向
     descStr: 'descending', // 降序排序的关键字符
   },