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

@@ -1,4 +1,4 @@
import { app } from '../../app.ts';
import { app, notCNBCheck } from '../../app.ts';
import './cnb-dev-env.ts';
import { useKey } from '@kevisual/context';
import { spawnSync } from 'node:child_process';
@@ -31,8 +31,9 @@ app.route({
path: 'cnb_board',
key: 'exit',
description: 'cnb的工作环境退出程序',
middleware: ['auth-admin'],
middleware: ['auth'],
}).define(async (ctx) => {
if (notCNBCheck(ctx)) return;
const cmd = 'kill 1';
execCommand(cmd);
}).addTo(app);