This commit is contained in:
Baobhan Sith
2025-04-26 15:20:37 +08:00
parent 93b8863fdd
commit e269f40754
80 changed files with 868 additions and 1528 deletions
@@ -120,8 +120,6 @@ export const incrementUsage = async (req: Request, res: Response): Promise<void>
// 即使没找到也可能返回成功,避免不必要的错误提示
console.warn(`尝试增加不存在的快捷指令 (ID: ${id}) 的使用次数`);
res.status(200).json({ message: '使用次数已记录 (或指令不存在)' });
// 或者严格一点返回 404:
// res.status(404).json({ message: '未找到要增加使用次数的快捷指令' });
}
} catch (error: any) {
console.error('增加快捷指令使用次数控制器出错:', error);
@@ -1,10 +1,10 @@
import { Router } from 'express';
import * as QuickCommandsController from './quick-commands.controller';
import { isAuthenticated } from '../auth/auth.middleware'; // 引入认证中间件
import { isAuthenticated } from '../auth/auth.middleware';
const router = Router();
// 应用认证中间件到所有快捷指令相关的路由
router.use(isAuthenticated);
// 定义路由