From 10b4b6656f0f396c2e9bdba2b0ecd3a38d0fd143 Mon Sep 17 00:00:00 2001 From: Hiven Date: Tue, 15 Aug 2023 16:14:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E9=87=8D=E6=9E=84=E5=90=88=E5=9B=BE?= =?UTF-8?q?=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/resource/etc/resource.yaml | 4 ++-- server/upload/etc/upload.yaml | 4 ++-- .../internal/logic/uploadfilebackendlogic.go | 24 ++++++++----------- 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/server/resource/etc/resource.yaml b/server/resource/etc/resource.yaml index 2b9f5737..a279336e 100644 --- a/server/resource/etc/resource.yaml +++ b/server/resource/etc/resource.yaml @@ -15,8 +15,8 @@ AWS: Secret: sjCEv0JxATnPCxno2KNLm0X8oDc7srUR+4vkYhvm Token: BLMService: - Url: "http://18.119.109.254:8999" - # Url: "http://192.168.1.7:8999" + # Url: "http://18.119.109.254:8999" + Url: "http://192.168.1.7:8999" LogoCombine: #Url: "http://192.168.1.7:8999/LogoCombine" Url: "http://18.119.109.254:8999/LogoCombine" \ No newline at end of file diff --git a/server/upload/etc/upload.yaml b/server/upload/etc/upload.yaml index 9d4ff5a2..2876ff61 100644 --- a/server/upload/etc/upload.yaml +++ b/server/upload/etc/upload.yaml @@ -16,5 +16,5 @@ AWS: Token: BLMService: ImageProcess: - #Url: "http://192.168.1.7:45678/FeatureExtraction" - Url: "http://18.119.109.254:8999/FeatureExtraction" + Url: "http://192.168.1.7:8999/FeatureExtraction" + # Url: "http://18.119.109.254:8999/FeatureExtraction" diff --git a/server/upload/internal/logic/uploadfilebackendlogic.go b/server/upload/internal/logic/uploadfilebackendlogic.go index 32a577c8..0422de8f 100644 --- a/server/upload/internal/logic/uploadfilebackendlogic.go +++ b/server/upload/internal/logic/uploadfilebackendlogic.go @@ -44,22 +44,18 @@ func NewUploadFileBackendLogic(r *http.Request, svcCtx *svc.ServiceContext) *Upl func (l *UploadFileBackendLogic) UploadFileBackend(req *types.UploadFileBackendReq, userinfo *auth.UserInfo) (resp *basic.Response) { // 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data) // userinfo 传入值时, 一定不为null - if userinfo.IsOnlooker() { - // 如果是,返回未授权的错误码 - return resp.SetStatus(basic.CodeUnAuth) - } - - // 定义用户ID和S3键名格式 - var userId int64 - var guestId int64 + var userId int64 = 0 + var guestId int64 = 0 // 检查用户是否是游客 - if userinfo.IsGuest() { - // 如果是,使用游客ID和游客键名格式 - guestId = userinfo.GuestId - } else { - // 否则,使用用户ID和用户键名格式 - userId = userinfo.UserId + if userinfo != nil { + if userinfo.IsGuest() { + // 如果是,使用游客ID和游客键名格式 + guestId = userinfo.GuestId + } else { + // 否则,使用用户ID和用户键名格式 + userId = userinfo.UserId + } } //设置内存大小