-- 修复礼物菜单路径 - 使用完整路径

-- 1. 更新子菜单的component路径为完整路径
UPDATE eb_system_menu 
SET component = '/gift/config/index'
WHERE name = '礼物列表' AND pid = (SELECT id FROM (SELECT id FROM eb_system_menu WHERE name = '礼物打赏' AND pid = 0) AS temp);

UPDATE eb_system_menu 
SET component = '/gift/records/index'
WHERE name = '打赏记录' AND pid = (SELECT id FROM (SELECT id FROM eb_system_menu WHERE name = '礼物打赏' AND pid = 0) AS temp);

UPDATE eb_system_menu 
SET component = '/gift/recharge/index'
WHERE name = '充值套餐' AND pid = (SELECT id FROM (SELECT id FROM eb_system_menu WHERE name = '礼物打赏' AND pid = 0) AS temp);

-- 2. 验证修复结果
SELECT 
    m.id,
    m.pid,
    m.name as '菜单名',
    m.component as '组件路径',
    m.menu_type as '类型'
FROM eb_system_menu m
WHERE m.name = '礼物打赏' OR m.pid = (SELECT id FROM eb_system_menu WHERE name = '礼物打赏' LIMIT 1)
ORDER BY m.pid, m.sort;

SELECT '路径已修复！请刷新浏览器页面' as message;
