diff --git a/routes/upload.js b/routes/upload.js index 9afa4e9..6d5bfd8 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:3006/uploads/${ctx.file.filename}` + const fileUrl = `https://donghy.top/uploads/${ctx.file.filename}` ctx.body = { code: 200, message: '上传成功**', diff --git a/scripts/fix-image-urls.js b/scripts/fix-image-urls.js index 9a71e1f..a384992 100644 --- a/scripts/fix-image-urls.js +++ b/scripts/fix-image-urls.js @@ -18,8 +18,8 @@ async function fixImageUrls() { const oldImages = item.images; // 替换所有 localhost:3000 和 localhost:3006 let newImages = oldImages - .replace(/http:\/\/localhost:3000/g, 'http://110.42.255.239:3006') - .replace(/http:\/\/localhost:3006/g, 'http://110.42.255.239:3006'); + .replace(/http:\/\/localhost:3000/g, 'https://donghy.top') + .replace(/http:\/\/localhost:3006/g, 'https://donghy.top'); 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:3006') - .replace(/http:\/\/localhost:3006/g, 'http://110.42.255.239:3006'); + .replace(/http:\/\/localhost:3000/g, 'https://donghy.top') + .replace(/http:\/\/localhost:3006/g, 'https://donghy.top'); await connection.execute( 'UPDATE points_goods SET images = ? WHERE id = ?',