diff --git a/lib/web/imageRouter/minio.js b/lib/web/imageRouter/minio.js index fe43f76f..d0dd5eef 100644 --- a/lib/web/imageRouter/minio.js +++ b/lib/web/imageRouter/minio.js @@ -32,16 +32,16 @@ exports.uploadImage = function (imagePath, callback) { return } - let key = path.join('uploads', path.basename(imagePath)) - let protocol = config.minio.secure ? 'https' : 'http' + const key = path.join('uploads', path.basename(imagePath)) + const protocol = config.minio.secure ? 'https' : 'http' minioClient.putObject(config.s3bucket, key, buffer, buffer.size, getImageMimeType(imagePath), function (err, data) { if (err) { callback(new Error(err), null) return } - let hidePort = [80, 443].includes(config.minio.port) - let urlPort = hidePort ? '' : `:${config.minio.port}` + const hidePort = [80, 443].includes(config.minio.port) + const urlPort = hidePort ? '' : `:${config.minio.port}` callback(null, `${protocol}://${config.minio.endPoint}${urlPort}/${config.s3bucket}/${key}`) }) })