From 3a2abde3b419288e8bcdd536f2fb367b2da79db4 Mon Sep 17 00:00:00 2001 From: momo <1012651275@qq.com> Date: Wed, 23 Aug 2023 15:10:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=A3=81=E5=89=AA=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/upload/internal/logic/uploadlogologic.go | 3 +-- service/repositories/image_handle.go | 6 ++++-- utils/file/upload.go | 5 ++++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/server/upload/internal/logic/uploadlogologic.go b/server/upload/internal/logic/uploadlogologic.go index 8120d330..6b6abea0 100644 --- a/server/upload/internal/logic/uploadlogologic.go +++ b/server/upload/internal/logic/uploadlogologic.go @@ -133,12 +133,11 @@ func (l *UploadLogoLogic) UploadLogo(req *types.UploadLogoReq, userinfo *auth.Us Height: "0", Proportion: "100", }) - logoUrl = resLogoStandard.ResourceUrl - if err != nil { logx.Error(err) return resp.SetStatus(basic.CodeServiceErr) } + logoUrl = resLogoStandard.ResourceUrl } else { logoUrl = uploadRes.ResourceUrl } diff --git a/service/repositories/image_handle.go b/service/repositories/image_handle.go index 43a68c54..4a89f61c 100644 --- a/service/repositories/image_handle.go +++ b/service/repositories/image_handle.go @@ -59,7 +59,7 @@ func (l *defaultImageHandle) LogoInfoSet(ctx context.Context, in *LogoInfoSetReq err := curl.NewClient(ctx, &curl.Config{ BaseUrl: *l.BLMServiceUrl, - Url: constants.BLMServiceUrlLogoCombine, + Url: constants.BLMServiceUrlLogoFeatureExtraction, }).PostJson(postMap, &resultBLM) if err != nil { logx.Error(err) @@ -70,7 +70,9 @@ func (l *defaultImageHandle) LogoInfoSet(ctx context.Context, in *LogoInfoSetReq logx.Error(err) return nil, err } - return nil, nil + return &LogoInfoSetRes{ + Res: resultBLM.Data.(string), + }, nil } /* logo信息 */ diff --git a/utils/file/upload.go b/utils/file/upload.go index 4539ef2f..0279422b 100644 --- a/utils/file/upload.go +++ b/utils/file/upload.go @@ -81,7 +81,10 @@ func (upload *Upload) UploadFileByBase64(req *UploadBaseReq) (*UploadBaseRes, er uploadBaseRes.ResourceId = resourceId uploadBaseRes.ResourceUrl = *resourceInfo.ResourceUrl } else { - resourceId = req.ResourceId + if req.ResourceId != "" { + resourceId = req.ResourceId + } + dist, contentType, err := FileBase64ToByte(req.FileData) if err != nil {