Browse Source

fix bug

tags/v1.21.12.1
e 5 years ago
parent
commit
eca90ee75c
1 changed files with 7 additions and 9 deletions
  1. +7
    -9
      routers/repo/attachment.go

+ 7
- 9
routers/repo/attachment.go View File

@@ -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,
})

}

Loading…
Cancel
Save