feat: 添加 cnb-board 路由以支持退出程序功能

This commit is contained in:
2026-02-23 18:56:20 +08:00
parent 4b935036ad
commit 58a0e9e61f

View File

@@ -2,6 +2,7 @@ import { app } from '../../app.ts';
import { getLiveMdContent } from './live/live-content.ts';
import './cnb-dev-env.ts';
import z from 'zod';
import { execCommand } from '@/module/npm-install.ts';
app.route({
path: 'cnb-board',
key: 'live',
@@ -21,3 +22,13 @@ app.route({
};
}).addTo(app);
app.route({
path: 'cnb-board',
key: 'exit',
description: 'cnb的工作环境退出程序',
middleware: ['auth-admin'],
}).define(async (ctx) => {
const cmd = 'kill 1';
execCommand(cmd);
}).addTo(app);