generated from template/apps-template
update
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
|
||||
// base
|
||||
import { app } from '../app.ts';
|
||||
import './noco/index.ts';
|
||||
import './noco/config.ts';
|
||||
|
||||
// 添加认证中间件路由
|
||||
const hasAuth = app.router.routes.some(r => r.id === 'auth');
|
||||
if (!hasAuth) {
|
||||
console.log('添加认证中间件路由');
|
||||
@@ -11,5 +15,7 @@ if (!hasAuth) {
|
||||
id: 'auth'
|
||||
}).define(async (ctx) => {
|
||||
// 这里可以添加实际的认证逻辑
|
||||
ctx.query.token = process.env.TOKEN || ' ';
|
||||
console.log('本地测试认证通过,设置 token');
|
||||
}).addTo(app);
|
||||
}
|
||||
Reference in New Issue
Block a user