feat: 添加 cnb-board 路由以支持退出程序功能
This commit is contained in:
@@ -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);
|
||||
Reference in New Issue
Block a user