更新路由定义,添加对 'auth' 的描述,优化列表获取逻辑
This commit is contained in:
@@ -20,7 +20,10 @@ app.route({
|
|||||||
key: 'list'
|
key: 'list'
|
||||||
}).define(async (ctx) => {
|
}).define(async (ctx) => {
|
||||||
ctx.body = {
|
ctx.body = {
|
||||||
list: app.router.getList()
|
list: app.router.getList((item) => {
|
||||||
|
if (item.id === 'auth') return false
|
||||||
|
return true
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}).addTo(app);
|
}).addTo(app);
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ import './routes/index.ts';
|
|||||||
// 如果是直接运行,则启动应用
|
// 如果是直接运行,则启动应用
|
||||||
|
|
||||||
app.route({
|
app.route({
|
||||||
id: 'auth'
|
id: 'auth',
|
||||||
|
description: 'Token 权限验证,临时方案',
|
||||||
}).define(async (ctx) => {
|
}).define(async (ctx) => {
|
||||||
// token authentication
|
// token authentication
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user