diff --git a/modules/storage/obs.go b/modules/storage/obs.go index 3943a5f29..cc621cc3c 100755 --- a/modules/storage/obs.go +++ b/modules/storage/obs.go @@ -634,10 +634,10 @@ func GetObsLogFileName(prefix string) ([]FileInfo, error) { log.Info("log fileName=" + val.Key) fileInfo := FileInfo{ ModTime: val.LastModified.Local().Format("2006-01-02 15:04:05"), - FileName: val.Key, + FileName: val.Key[len(prefix)-3:], //加上 job Size: val.Size, IsDir: false, - ParenDir: "", + ParenDir: prefix[0 : len(prefix)-3], } fileInfos = append(fileInfos, fileInfo) } diff --git a/routers/repo/modelarts.go b/routers/repo/modelarts.go index 11f0b2e9b..7ffe5fef3 100755 --- a/routers/repo/modelarts.go +++ b/routers/repo/modelarts.go @@ -2894,9 +2894,9 @@ func TrainJobDownloadLogFile(ctx *context.Context) { return } if len(key) > 1 { - ObsDownloadManyFile("", ctx, task.DisplayJobName+".zip", key) + ObsDownloadManyFile(prefix[0:len(prefix)-3], ctx, task.DisplayJobName+".zip", key) } else { - url, err := storage.GetObsCreateSignedUrlByBucketAndKey(setting.Bucket, key[0].FileName) + url, err := storage.GetObsCreateSignedUrlByBucketAndKey(setting.Bucket, key[0].ParenDir+key[0].FileName) if err != nil { log.Error("GetObsCreateSignedUrlByBucketAndKey failed: %v", err.Error(), ctx.Data["msgID"]) ctx.ServerError("GetObsCreateSignedUrlByBucketAndKey", err)