feat(menu): 外链菜单改用 external_url 承载

- 数据大屏由目录改为站内外链,移除三个子菜单
- 外链透传前端的判断由内嵌改为外链
- 提示词同级菜单示例的路径去掉前导斜杠
This commit is contained in:
Ray.Hao committed 2026-09-30 12:39:22 +08:00
1 parent 1243a311e0
commit ab8d9065fb
3 files changed
+19 -35

No files matched your search

@@ -51,7 +51,7 @@ public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements Me
private final RoleMenuService roleMenuService;
/** 系统提示词名称,对应 resources/prompts 下的相对路径 */
// 系统提示词名称,对应 resources/prompts 下的相对路径
private static final String SYSTEM_PROMPT_PATH = "menu/system.md";
private final AiChatService aiChatService;
@@ -277,7 +277,8 @@ public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements Me
&& ObjectUtil.equals(menu.getKeepAlive(), 1)) {
meta.setKeepAlive(true);
}
if (isEmbedded && StrUtil.isNotBlank(externalUrl)) {
// 外链地址透传前端:新标签页按站内外链打开,内嵌模式供 iframe 页取址
if (isExternal && StrUtil.isNotBlank(externalUrl)) {
meta.setExternalUrl(externalUrl);
}
@@ -611,10 +612,11 @@ public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements Me
if (CollectionUtil.isEmpty(siblings)) {
text.append("(无)\n");
} else {
// 示例路径只展示当前这一级的路径片段
siblings.forEach(menu -> text.append("- ")
.append(menu.getName())
.append("(类型 ").append(menuTypeLabel(menu.getType()))
.append(",路径片段 ").append(StrUtil.blankToDefault(menu.getRoutePath(), "无"))
.append(",路径片段 ").append(StrUtil.blankToDefault(StrUtil.removePrefix(menu.getRoutePath(), "/"), "无"))
.append(",权限 ").append(StrUtil.blankToDefault(menu.getPerm(), "无"))
.append(")\n"));
}
+1 -2
View File
@@ -8,8 +8,7 @@
推断规则:
- 目录、页面推断 routePath 与 iconKeywords;按钮推断 perm;外链不推断任何字段
- routePath 不是完整访问地址:不管挂在哪一级,都只输出自己这一段的路径,上位路径由系统拼接
- 「同级菜单示例」里的路径带前导斜杠是目录的存储格式,输出时不要带
- 命名风格必须与「同级菜单示例」保持一致,模块前缀优先沿用示例中已出现的写法
- iconKeywords 用通用的名词语义(如 user、order、chart),不要用形容词
- 不要自创新的模块前缀,示例中无法参照时按系统现有命名习惯推断
- 无法确定时留空,不要编造
- 无法确定时留空:routePath、perm 输出空字符串,iconKeywords 输出空数组,不要编造