From 1002b36c0a698c794320d1544c464c13b303e53c Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: Thu, 16 Apr 2026 13:44:02 +0800
Subject: [PATCH] 优化白名单支持对通配符路径匹配
---
ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/service/GenTableServiceImpl.java | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/service/GenTableServiceImpl.java b/ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/service/GenTableServiceImpl.java
index 30af466..4498e13 100644
--- a/ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/service/GenTableServiceImpl.java
+++ b/ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/service/GenTableServiceImpl.java
@@ -209,7 +209,7 @@
VelocityContext context = VelocityUtils.prepareContext(table);
// 获取模板列表
- List<String> templates = VelocityUtils.getTemplateList(table.getTplCategory(), table.getTplWebType());
+ List<String> templates = VelocityUtils.getTemplateList(table);
for (String template : templates)
{
// 渲染模板
@@ -253,10 +253,10 @@
VelocityContext context = VelocityUtils.prepareContext(table);
// 获取模板列表
- List<String> templates = VelocityUtils.getTemplateList(table.getTplCategory(), table.getTplWebType());
+ List<String> templates = VelocityUtils.getTemplateList(table);
for (String template : templates)
{
- if (!StringUtils.containsAny(template, "sql.vm", "api.js.vm", "index.vue.vm", "index-tree.vue.vm"))
+ if (!StringUtils.containsAny(template, "sql.vm", "api.js.vm", "api.ts.vm", "type.ts.vm", "index.ts.vm", "index.vue.vm", "index-tree.vue.vm", "view.vue.vm"))
{
// 渲染模板
StringWriter sw = new StringWriter();
@@ -371,7 +371,7 @@
VelocityContext context = VelocityUtils.prepareContext(table);
// 获取模板列表
- List<String> templates = VelocityUtils.getTemplateList(table.getTplCategory(), table.getTplWebType());
+ List<String> templates = VelocityUtils.getTemplateList(table);
for (String template : templates)
{
// 渲染模板
@@ -524,12 +524,14 @@
String treeName = paramsObj.getString(GenConstants.TREE_NAME);
Long parentMenuId = paramsObj.getLongValue(GenConstants.PARENT_MENU_ID);
String parentMenuName = paramsObj.getString(GenConstants.PARENT_MENU_NAME);
+ boolean isView = paramsObj.getBooleanValue(GenConstants.GEN_VIEW);
genTable.setTreeCode(treeCode);
genTable.setTreeParentCode(treeParentCode);
genTable.setTreeName(treeName);
genTable.setParentMenuId(parentMenuId);
genTable.setParentMenuName(parentMenuName);
+ genTable.setView(isView);
}
}
--
Gitblit v1.9.3