diff --git a/lib/web/imageRouter/minio.js b/lib/web/imageRouter/minio.js index f72b31c3..fe43f76f 100644 --- a/lib/web/imageRouter/minio.js +++ b/lib/web/imageRouter/minio.js @@ -40,7 +40,9 @@ exports.uploadImage = function (imagePath, callback) { callback(new Error(err), null) return } - callback(null, `${protocol}://${config.minio.endPoint}:${config.minio.port}/${config.s3bucket}/${key}`) + let hidePort = [80, 443].includes(config.minio.port) + let urlPort = hidePort ? '' : `:${config.minio.port}` + callback(null, `${protocol}://${config.minio.endPoint}${urlPort}/${config.s3bucket}/${key}`) }) }) }