From eca90ee75c8ec1383ceaf00f4e15aba8f5a79751 Mon Sep 17 00:00:00 2001 From: e <747342561@qq.com> Date: Wed, 3 Jun 2020 10:47:05 +0800 Subject: [PATCH] fix bug --- routers/repo/attachment.go | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/routers/repo/attachment.go b/routers/repo/attachment.go index 5797c999c..5ef85b820 100644 --- a/routers/repo/attachment.go +++ b/routers/repo/attachment.go @@ -203,24 +203,22 @@ func GetPresignedPutObjectURL(ctx *context.Context) { return } - uuid := "" - url := "" - if setting.Attachment.StoreType == storage.MinioStorageType { - uuid = gouuid.NewV4().String() + uuid := gouuid.NewV4().String() url, err := storage.Attachments.PresignedPutURL(models.AttachmentRelativePath(uuid)) if err != nil { ctx.ServerError("PresignedPutURL", err) return } - log.Trace(url) + + ctx.JSON(200, map[string]string{ + "uuid": uuid, + "url": url, + }) } else { ctx.Error(404, "storage type is not enabled") return } - ctx.JSON(200, map[string]string{ - "uuid": uuid, - "url": url, - }) + }