From 4887c89c898cbf6b6ddd84bdce1e866947da2ebb Mon Sep 17 00:00:00 2001 From: zouap Date: Tue, 15 Nov 2022 11:55:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81=EF=BC=8C?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/repo/attachment_model.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/routers/repo/attachment_model.go b/routers/repo/attachment_model.go index e89666174..15da4f54f 100644 --- a/routers/repo/attachment_model.go +++ b/routers/repo/attachment_model.go @@ -144,13 +144,11 @@ func GetModelChunks(ctx *context.Context) { if dbmodeluuid != modeluuid { log.Info("The file has uploaded.fileChunk.ObjectName=" + fileChunk.ObjectName + " typeCloudBrain=" + fmt.Sprint(typeCloudBrain)) isExist := copyModelAttachmentFile(typeCloudBrain, fileChunk, fileName, modeluuid) - if dbmodeluuid != "" { - model, err := models.QueryModelById(dbmodeluuid) + if isExist { + model, err := models.QueryModelById(modeluuid) if err == nil && model != nil { modelname = model.Name } - } - if isExist { ctx.JSON(200, map[string]string{ "uuid": fileChunk.UUID, "uploaded": strconv.Itoa(fileChunk.IsUploaded),