更换端口
This commit is contained in:
@@ -60,7 +60,7 @@ router.use('/api/ai', aiRoutes)
|
|||||||
app.use(router.routes())
|
app.use(router.routes())
|
||||||
app.use(router.allowedMethods())
|
app.use(router.allowedMethods())
|
||||||
|
|
||||||
const PORT = process.env.PORT || 3005
|
const PORT = process.env.PORT || 3006
|
||||||
app.listen(PORT, () => {
|
app.listen(PORT, () => {
|
||||||
console.log(`Server running on port ${PORT}`)
|
console.log(`Server running on port ${PORT}`)
|
||||||
})
|
})
|
||||||
+1
-1
@@ -36,7 +36,7 @@ router.post('/', upload.single('file'), async (ctx) => {
|
|||||||
return
|
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 = {
|
ctx.body = {
|
||||||
code: 200,
|
code: 200,
|
||||||
message: '上传成功**',
|
message: '上传成功**',
|
||||||
|
|||||||
@@ -16,10 +16,10 @@ async function fixImageUrls() {
|
|||||||
for (const item of goods) {
|
for (const item of goods) {
|
||||||
if (item.images) {
|
if (item.images) {
|
||||||
const oldImages = item.images;
|
const oldImages = item.images;
|
||||||
// 替换所有 localhost:3000 和 localhost:3005
|
// 替换所有 localhost:3000 和 localhost:3006
|
||||||
let newImages = oldImages
|
let newImages = oldImages
|
||||||
.replace(/http:\/\/localhost:3000/g, 'http://110.42.255.239:3005')
|
.replace(/http:\/\/localhost:3000/g, 'http://110.42.255.239:3006')
|
||||||
.replace(/http:\/\/localhost:3005/g, 'http://110.42.255.239:3005');
|
.replace(/http:\/\/localhost:3006/g, 'http://110.42.255.239:3006');
|
||||||
|
|
||||||
await connection.execute(
|
await connection.execute(
|
||||||
'UPDATE goods SET images = ? WHERE id = ?',
|
'UPDATE goods SET images = ? WHERE id = ?',
|
||||||
@@ -41,8 +41,8 @@ async function fixImageUrls() {
|
|||||||
if (item.images) {
|
if (item.images) {
|
||||||
const oldImages = item.images;
|
const oldImages = item.images;
|
||||||
let newImages = oldImages
|
let newImages = oldImages
|
||||||
.replace(/http:\/\/localhost:3000/g, 'http://110.42.255.239:3005')
|
.replace(/http:\/\/localhost:3000/g, 'http://110.42.255.239:3006')
|
||||||
.replace(/http:\/\/localhost:3005/g, 'http://110.42.255.239:3005');
|
.replace(/http:\/\/localhost:3006/g, 'http://110.42.255.239:3006');
|
||||||
|
|
||||||
await connection.execute(
|
await connection.execute(
|
||||||
'UPDATE points_goods SET images = ? WHERE id = ?',
|
'UPDATE points_goods SET images = ? WHERE id = ?',
|
||||||
|
|||||||
Reference in New Issue
Block a user