From d105f7471b0001f1ecb75cfe4489360bc892423a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E6=B5=B7=E6=B4=8B?= Date: Sun, 24 May 2026 10:49:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=8D=A2=E7=AB=AF=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 2 +- routes/upload.js | 2 +- scripts/fix-image-urls.js | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app.js b/app.js index fc09fe8..b9c0f1c 100644 --- a/app.js +++ b/app.js @@ -60,7 +60,7 @@ router.use('/api/ai', aiRoutes) app.use(router.routes()) app.use(router.allowedMethods()) -const PORT = process.env.PORT || 3005 +const PORT = process.env.PORT || 3006 app.listen(PORT, () => { console.log(`Server running on port ${PORT}`) }) \ No newline at end of file diff --git a/routes/upload.js b/routes/upload.js index 70f5382..9afa4e9 100644 --- a/routes/upload.js +++ b/routes/upload.js @@ -36,7 +36,7 @@ router.post('/', upload.single('file'), async (ctx) => { return } - const fileUrl = `http://110.42.255.239:3005/uploads/${ctx.file.filename}` + const fileUrl = `http://110.42.255.239:3006/uploads/${ctx.file.filename}` ctx.body = { code: 200, message: '上传成功**', diff --git a/scripts/fix-image-urls.js b/scripts/fix-image-urls.js index 5714895..9a71e1f 100644 --- a/scripts/fix-image-urls.js +++ b/scripts/fix-image-urls.js @@ -16,10 +16,10 @@ async function fixImageUrls() { for (const item of goods) { if (item.images) { const oldImages = item.images; - // 替换所有 localhost:3000 和 localhost:3005 + // 替换所有 localhost:3000 和 localhost:3006 let newImages = oldImages - .replace(/http:\/\/localhost:3000/g, 'http://110.42.255.239:3005') - .replace(/http:\/\/localhost:3005/g, 'http://110.42.255.239:3005'); + .replace(/http:\/\/localhost:3000/g, 'http://110.42.255.239:3006') + .replace(/http:\/\/localhost:3006/g, 'http://110.42.255.239:3006'); await connection.execute( 'UPDATE goods SET images = ? WHERE id = ?', @@ -41,8 +41,8 @@ async function fixImageUrls() { if (item.images) { const oldImages = item.images; let newImages = oldImages - .replace(/http:\/\/localhost:3000/g, 'http://110.42.255.239:3005') - .replace(/http:\/\/localhost:3005/g, 'http://110.42.255.239:3005'); + .replace(/http:\/\/localhost:3000/g, 'http://110.42.255.239:3006') + .replace(/http:\/\/localhost:3006/g, 'http://110.42.255.239:3006'); await connection.execute( 'UPDATE points_goods SET images = ? WHERE id = ?',