-- 测试管理菜单路由名称修复;执行前备份并确认当前连接库,可重复执行。 -- 菜单路径 tasks 默认生成 Tasks,与生产任务重名时会被 Vue Router 覆盖,造成生产页面 404。 -- 只修正本模块未配置或仍使用默认值的路由名称,保留自定义名称、菜单地址、角色授权和业务数据。 SET NAMES utf8mb4; START TRANSACTION; UPDATE sys_menu SET route_name = CASE component WHEN 'testing/projects/index' THEN 'TestingProjects' WHEN 'testing/tasks/index' THEN 'TestingTasks' WHEN 'testing/catalog/index' THEN 'TestingCatalog' WHEN 'testing/calibrations/index' THEN 'TestingCalibrations' WHEN 'testing/analysis/index' THEN 'TestingAnalysis' END WHERE menu_type = 'C' AND component IN ( 'testing/projects/index', 'testing/tasks/index', 'testing/catalog/index', 'testing/calibrations/index', 'testing/analysis/index' ) AND (route_name IS NULL OR route_name = '' OR BINARY route_name = BINARY CONCAT(UPPER(LEFT(path, 1)), SUBSTRING(path, 2))); COMMIT;