refactor: 移除调试日志并优化代码结构
feat(components): 新增设备管理相关组件和仪表盘组件 feat(hooks): 添加自定义hooks用于API调用和数据管理 style: 优化滚动条样式和模态框布局 chore: 清理无用脚本和调试文件 docs: 更新组件导出文件
This commit is contained in:
@@ -81,8 +81,6 @@ router.get('/plans', async (req, res) => {
|
||||
|
||||
router.get('/plans/:planId', async (req, res) => {
|
||||
try {
|
||||
console.log('=== GET /plans/:planId ===', req.params.planId);
|
||||
|
||||
const plan = await InventoryPlan.findByPk(req.params.planId, {
|
||||
include: [
|
||||
{ model: require('../models/User'), as: 'Creator', attributes: ['userId', 'username', 'realName'] }
|
||||
@@ -90,7 +88,6 @@ router.get('/plans/:planId', async (req, res) => {
|
||||
});
|
||||
|
||||
if (!plan) {
|
||||
console.log('Plan not found');
|
||||
return res.status(404).json({ error: '盘点计划不存在' });
|
||||
}
|
||||
|
||||
@@ -102,10 +99,8 @@ router.get('/plans/:planId', async (req, res) => {
|
||||
order: [['createdAt', 'ASC']]
|
||||
});
|
||||
|
||||
console.log('Found tasks:', tasks.length);
|
||||
res.json({ plan, tasks });
|
||||
} catch (error) {
|
||||
console.error('Error:', error);
|
||||
res.status(500).json({ error: error.message });
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user