Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -54,15 +54,4 @@ export const simpleRouter = useContextKey('simpleRouter', () => {
|
||||
return new SimpleRouter();
|
||||
});
|
||||
|
||||
app.route({
|
||||
path: 'router',
|
||||
key: 'list',
|
||||
description: '获取路由列表',
|
||||
}).define(async (ctx) => {
|
||||
const list = ctx.app.getList((item) => {
|
||||
if (item?.path?.includes?.('auth') || item?.id?.includes?.('auth')) return false;
|
||||
return true;
|
||||
})
|
||||
console.log('路由列表:', list.length);
|
||||
ctx.body = { list }
|
||||
}).addTo(app);
|
||||
app.createRouteList()
|
||||
Reference in New Issue
Block a user