Browse Source

修复视频上传功能,添加图片Urls到编辑API

pull/4/head
Trae AI 2 months ago
parent
commit
adfb2db2a6
  1. 9
      Reject.js

9
Reject.js

@ -1170,8 +1170,7 @@ app.put('/api/supplies/:id/edit', async (req, res) => {
} }
} }
<<<<<<< Updated upstream
=======
// 处理媒体文件上传(图片和视频) // 处理媒体文件上传(图片和视频)
let uploadedImageUrls = []; let uploadedImageUrls = [];
if (Array.isArray(imageUrls) && imageUrls.length > 0) { if (Array.isArray(imageUrls) && imageUrls.length > 0) {
@ -1216,20 +1215,20 @@ app.put('/api/supplies/:id/edit', async (req, res) => {
console.log('媒体文件处理完成,成功上传', uploadedImageUrls.length, '个文件'); console.log('媒体文件处理完成,成功上传', uploadedImageUrls.length, '个文件');
} }
>>>>>>> Stashed changes
// 更新货源信息 // 更新货源信息
const updateQuery = ` const updateQuery = `
UPDATE products UPDATE products
SET productName = ?, price = ?, quantity = ?, grossWeight = ?, SET productName = ?, price = ?, quantity = ?, grossWeight = ?,
yolk = ?, specification = ?, supplyStatus = ?, description = ?, region = ?, yolk = ?, specification = ?, supplyStatus = ?, description = ?, region = ?,
producting = ?, product_contact = ?, contact_phone = ? producting = ?, product_contact = ?, contact_phone = ?, imageUrls = ?
WHERE id = ? WHERE id = ?
`; `;
await connection.query(updateQuery, [ await connection.query(updateQuery, [
productName, price.toString(), parseInt(quantity), grossWeight, productName, price.toString(), parseInt(quantity), grossWeight,
yolk, specification, supplyStatus, description, region, yolk, specification, supplyStatus, description, region,
producting, productContact, contactPhone, productId producting, productContact, contactPhone, JSON.stringify(uploadedImageUrls), productId
]); ]);
// 提交事务 // 提交事务

Loading…
Cancel
Save