This commit is contained in:
董海洋
2026-05-24 17:48:20 +08:00
parent e41eb624b9
commit e532e48e47
3 changed files with 33 additions and 5 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ const Router = require('koa-router')
const multer = require('@koa/multer')
const path = require('path')
const fs = require('fs')
const { IMG_BASE_URL } = require('../config/domain')
const router = new Router()
@@ -36,7 +37,7 @@ router.post('/', upload.single('file'), async (ctx) => {
return
}
const fileUrl = `https://donghy.top/img/${ctx.file.filename}`
const fileUrl = `${IMG_BASE_URL}/${ctx.file.filename}`
ctx.body = {
code: 200,
message: '上传成功',