feat: exit shell on disconnect

This commit is contained in:
wancat committed 2023-08-30 19:52:40 +08:00
1 parent d9836318db
commit 99da610d9e
4 files changed
+22 -12

No files matched your search

@@ -7,7 +7,6 @@ import CommandHandler from '../../game/commandHandler.js'
export async function newCommand(req, res) {
console.log('new command:', req.body)
const { token, command, pwd, output, error, ...additionalData } = req.body
console.log('additionalData:', additionalData)
if (!command) {
res.status(400).json({ message: 'command is required' })
@@ -50,7 +49,6 @@ export async function newCommand(req, res) {
const commandHandler = new CommandHandler(session, c, additionalData)
const response = await commandHandler.run()
console.log(response)
res.status(201).json(response)
await session.save()