zhibo/Zhibo/zhibo-h/sql/add_sensitive_word_menu.sql
2025-12-26 15:16:40 +08:00

42 lines
1.8 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 添加敏感词管理菜单
-- 注意需要先查询用户管理菜单的ID然后将其作为父ID
-- 1. 首先查询用户管理菜单的ID
-- SELECT id FROM eb_system_menu WHERE component = '/user' OR name = '用户';
-- 2. 假设用户管理菜单的ID是 X执行以下SQL添加敏感词管理子菜单
-- 请根据实际情况修改 pid 的值
-- 方法1如果你知道用户菜单的ID直接插入
-- INSERT INTO eb_system_menu (pid, name, icon, perms, component, menu_type, sort, is_show, is_delete, create_time, update_time)
-- VALUES (用户菜单ID, '敏感词管理', '', 'admin:sensitive:list', '/user/sensitive', 'M', 70, 1, 0, NOW(), NOW());
-- 方法2使用子查询自动获取用户菜单ID
INSERT INTO eb_system_menu (pid, name, icon, perms, component, menu_type, sort, is_show, is_delete, create_time, update_time)
SELECT
id as pid,
'敏感词管理' as name,
'' as icon,
'admin:sensitive:list' as perms,
'/user/sensitive' as component,
'M' as menu_type,
70 as sort,
1 as is_show,
0 as is_delete,
NOW() as create_time,
NOW() as update_time
FROM eb_system_menu
WHERE component = '/user' OR name = '用户'
LIMIT 1;
-- 如果上面的SQL不起作用可以尝试以下步骤
-- 步骤1查询用户菜单ID
-- SELECT id, name, component FROM eb_system_menu WHERE name LIKE '%用户%' OR component LIKE '%user%';
-- 步骤2手动插入将 ? 替换为查询到的ID
-- INSERT INTO eb_system_menu (pid, name, icon, perms, component, menu_type, sort, is_show, is_delete, create_time, update_time)
-- VALUES (?, '敏感词管理', '', 'admin:sensitive:list', '/user/sensitive', 'M', 70, 1, 0, NOW(), NOW());
-- 验证插入结果
-- SELECT * FROM eb_system_menu WHERE name = '敏感词管理';