chore: 更新依赖版本,移除不必要的路由定义

This commit is contained in:
2026-02-18 03:28:04 +08:00
parent 6c611dcf78
commit 9d39e1cd46
3 changed files with 15 additions and 38 deletions

View File

@@ -161,32 +161,9 @@ app
})
.addTo(app);
app
.route({
path: 'router',
key: 'list',
description: '列出所有的当前的可请求的路由信息',
middleware: ['auth-can']
})
.define(async (ctx) => {
const tokenUser = ctx.state.tokenUser;
let isUser = !!tokenUser;
const routesList = app.router.routes.filter(item => {
if (item.id === 'auth' || item.id === 'auth-can' || item.id === 'check-auth-admin' || item.id === 'auth-admin') {
return false;
}
return true;
}).map((item) => {
const route = pick(item, ['id', 'path', 'key', 'description', 'middleware'] as const);
return toJSONSchema(route);
})
ctx.body = {
list: routesList,
isUser
}
})
.addTo(app);
app.createRouteList({
middleware: ['auth-can']
})
app.route({
path: 'system',