From c0b773634a7238b1ea26e4230ed4fc91be64c6ed Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Tue, 19 Sep 2023 11:42:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6develop?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/shopping-cart/internal/logic/getcartslogic.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/shopping-cart/internal/logic/getcartslogic.go b/server/shopping-cart/internal/logic/getcartslogic.go index 303716f4..f79d8db3 100644 --- a/server/shopping-cart/internal/logic/getcartslogic.go +++ b/server/shopping-cart/internal/logic/getcartslogic.go @@ -41,6 +41,9 @@ func NewGetCartsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetCarts // } func (l *GetCartsLogic) GetCarts(req *types.GetCartsReq, userinfo *auth.UserInfo) (resp *basic.Response) { + if !userinfo.IsUser() { + return resp.SetStatusWithMessage(basic.CodeUnAuth, "please sign in") + } if req.CurrentPage <= 0 { req.CurrentPage = constants.DEFAULT_PAGE }