Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.1.2
zouap 3 years ago
parent
commit
594ee6a73c
1 changed files with 10 additions and 1 deletions
  1. +10
    -1
      routers/repo/ai_model_manage.go

+ 10
- 1
routers/repo/ai_model_manage.go View File

@@ -372,7 +372,16 @@ func DownloadSingleModelFile(ctx *context.Context) {
parentDir := ctx.Query("parentDir")
fileName := ctx.Query("fileName")
path := Model_prefix + models.AttachmentRelativePath(id) + "/" + parentDir + fileName

task, err := models.QueryModelById(id)
if err != nil {
log.Error("no such model!", err.Error())
ctx.ServerError("no such model:", err)
return
}
if !isOper(ctx, task.UserId) {
ctx.Error(403)
return
}
if setting.PROXYURL != "" {
body, err := storage.ObsDownloadAFile(setting.Bucket, path)
if err != nil {


Loading…
Cancel
Save