浏览代码

url decode

master
e 5 年前
父节点
当前提交
e4c39bfcfa
共有 1 个文件被更改,包括 10 次插入2 次删除
  1. +10
    -2
      routers/repo/dataset.go

+ 10
- 2
routers/repo/dataset.go 查看文件

@@ -2,6 +2,7 @@ package repo

import (
"code.gitea.io/gitea/modules/storage"
"net/url"
"sort"

"code.gitea.io/gitea/models"
@@ -81,12 +82,19 @@ func DatasetIndex(ctx *context.Context) {
ctx.Data["Attachments"] = attachments
ctx.Data["IsOwner"] = true
uuid := gouuid.NewV4().String()
url, err := storage.Attachments.PresignedPutURL(models.AttachmentRelativePath(uuid))
log.Info(uuid)
tmpUrl, err := storage.Attachments.PresignedPutURL(models.AttachmentRelativePath(uuid))
if err != nil {
ctx.ServerError("PresignedPutURL", err)
}
log.Info(tmpUrl)
preUrl,err := url.QueryUnescape(tmpUrl)
if err != nil {
ctx.ServerError("QueryUnescape", err)
}
log.Info(preUrl)
ctx.Data["uuid"] = uuid
ctx.Data["url"] = url
ctx.Data["url"] = preUrl
renderAttachmentSettings(ctx)

ctx.HTML(200, tplIndex)


正在加载...
取消
保存