update
This commit is contained in:
@@ -1,13 +1,11 @@
|
||||
import { Router } from 'express';
|
||||
import * as CommandHistoryController from './command-history.controller';
|
||||
import { isAuthenticated } from '../auth/auth.middleware'; // 使用正确的认证中间件
|
||||
import { isAuthenticated } from '../auth/auth.middleware';
|
||||
|
||||
const router = Router();
|
||||
|
||||
// 应用认证中间件到所有命令历史记录相关的路由
|
||||
router.use(isAuthenticated);
|
||||
|
||||
// 定义路由
|
||||
router.post('/', CommandHistoryController.addCommand); // POST /api/command-history
|
||||
router.get('/', CommandHistoryController.getAllCommands); // GET /api/command-history
|
||||
router.delete('/:id', CommandHistoryController.deleteCommand); // DELETE /api/command-history/:id
|
||||
|
||||
Reference in New Issue
Block a user