-- 检查系统菜单表结构
USE ry-vue;

-- 查看sys_menu表结构
DESCRIBE sys_menu;

-- 查看sys_role_menu表结构
DESCRIBE sys_role_menu;

-- 查看现有菜单数据
SELECT id, menu_name, parent_id, path, component, perms FROM sys_menu WHERE parent_id = 1;

-- 查看管理员角色
SELECT * FROM sys_role WHERE role_key = 'admin';

-- 查看管理员角色的权限
SELECT rm.role_id, m.menu_name, m.perms 
FROM sys_role_menu rm 
JOIN sys_menu m ON rm.menu_id = m.id 
WHERE rm.role_id = (SELECT role_id FROM sys_role WHERE role_key = 'admin') 
ORDER BY m.parent_id, m.order_num;