feat: 重构CNB管理模块,添加清理记录功能,更新中间件为统一认证方式,优化工作空间相关路由

This commit is contained in:
xiongxiao
2026-03-09 18:54:33 +08:00
committed by cnb
parent 21ba07e55b
commit 382c4809ea
25 changed files with 296 additions and 73 deletions

View File

@@ -8,6 +8,8 @@ import './knowledge/index.ts'
import './issues/index.ts'
import './cnb-board/index.ts';
import './share/index.ts';
import './cnb-manager/index.ts';
/**
* 验证上下文中的 App ID 是否与指定的 App ID 匹配
* @param {any} ctx - 上下文对象,可能包含 appId 属性
@@ -32,6 +34,9 @@ app.route({
}).define(async (ctx) => {
// ctx.body = 'Auth Route';
if (checkAppId(ctx, app.appId)) {
ctx.state.tokenUser = {
username: 'default',
}
return;
}
}).addTo(app, { overwrite: false });
@@ -43,6 +48,9 @@ app.route({
}).define(async (ctx) => {
// ctx.body = 'Admin Auth Route';
if (checkAppId(ctx, app.appId)) {
ctx.state.tokenUser = {
username: 'default',
}
return;
}
}).addTo(app, { overwrite: false });