From 463d3e2315b4f0a9ba1ac4d94b8840ae326fe521 Mon Sep 17 00:00:00 2001 From: shanshanzhong Date: Wed, 6 May 2026 03:19:04 -0700 Subject: [PATCH] x --- internal/logic/public/user/getDeviceListLogic.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/internal/logic/public/user/getDeviceListLogic.go b/internal/logic/public/user/getDeviceListLogic.go index b56702e..d592699 100644 --- a/internal/logic/public/user/getDeviceListLogic.go +++ b/internal/logic/public/user/getDeviceListLogic.go @@ -28,12 +28,15 @@ func NewGetDeviceListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Get func (l *GetDeviceListLogic) GetDeviceList() (resp *types.GetDeviceListResponse, err error) { userInfo := l.ctx.Value(constant.CtxKeyUser).(*user.User) - scopeHelper := newFamilyScopeHelper(l.ctx, l.svcCtx) - scopeUserIds, err := scopeHelper.resolveScopedUserIds(userInfo.Id) - if err != nil { - return nil, err - } - list, count, err := l.svcCtx.UserModel.QueryDeviceListByUserIds(l.ctx, scopeUserIds) + // 只查当前用户自己的设备(不查家庭组其他成员的设备) + // 原始代码(保留以供对照): + // scopeHelper := newFamilyScopeHelper(l.ctx, l.svcCtx) + // scopeUserIds, err := scopeHelper.resolveScopedUserIds(userInfo.Id) + // if err != nil { + // return nil, err + // } + // list, count, err := l.svcCtx.UserModel.QueryDeviceListByUserIds(l.ctx, scopeUserIds) + list, count, err := l.svcCtx.UserModel.QueryDeviceList(l.ctx, userInfo.Id) if err != nil { return nil, err }