fix: 修复NapCat WebUI菜单路由白名单

This commit is contained in:
sunlei 2026-06-24 18:05:02 +08:00
parent 5128657749
commit 726064c4e2
2 changed files with 58 additions and 0 deletions

View File

@ -37,6 +37,34 @@ describe('core menu api', () => {
path: '/unsupported', path: '/unsupported',
component: '/unsupported/index', component: '/unsupported/index',
}, },
{
name: 'QqBot',
path: '/qqbot',
children: [
{
name: 'QqBotAccount',
path: '/qqbot/account',
component: '/qqbot/account/list',
children: [
{
name: 'QqBotAccountWebUI',
authCode: 'QqBot:Account:WebUI',
type: 'button',
},
],
},
{
name: 'QqBotAccountNapcatWebui',
path: '/qqbot/account/:accountId/napcat-webui',
component: '/qqbot/account/napcat-webui/index',
meta: {
activePath: '/qqbot/account',
hideInMenu: true,
title: 'NapCat WebUI',
},
},
],
},
]); ]);
const { getAllMenusApi } = await import('./menu'); const { getAllMenusApi } = await import('./menu');
@ -61,6 +89,34 @@ describe('core menu api', () => {
}, },
], ],
}, },
{
name: 'QqBot',
path: '/qqbot',
children: [
{
name: 'QqBotAccount',
path: '/qqbot/account',
component: '/qqbot/account/list',
children: [
{
name: 'QqBotAccountWebUI',
authCode: 'QqBot:Account:WebUI',
type: 'button',
},
],
},
{
name: 'QqBotAccountNapcatWebui',
path: '/qqbot/account/:accountId/napcat-webui',
component: '/qqbot/account/napcat-webui/index',
meta: {
activePath: '/qqbot/account',
hideInMenu: true,
title: 'NapCat WebUI',
},
},
],
},
]); ]);
}); });
}); });

View File

@ -31,7 +31,9 @@ const SUPPORTED_ADMIN_MENU_NAMES = new Set([
'QqBotAccountDelete', 'QqBotAccountDelete',
'QqBotAccountEdit', 'QqBotAccountEdit',
'QqBotAccountKick', 'QqBotAccountKick',
'QqBotAccountNapcatWebui',
'QqBotAccountRefreshLogin', 'QqBotAccountRefreshLogin',
'QqBotAccountWebUI',
'QqBotCommand', 'QqBotCommand',
'QqBotCommandCreate', 'QqBotCommandCreate',
'QqBotCommandDelete', 'QqBotCommandDelete',