From 559d59b4f872f14a9b54c1114f7595dbb347b88c Mon Sep 17 00:00:00 2001 From: shanshanzhong Date: Wed, 6 May 2026 03:09:15 -0700 Subject: [PATCH] 000000 --- .../public/user/bindEmailWithVerificationLogic.go | 5 ++++- internal/logic/public/user/getDeviceListLogic.go | 11 +++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/internal/logic/public/user/bindEmailWithVerificationLogic.go b/internal/logic/public/user/bindEmailWithVerificationLogic.go index ae29688..a31f1c4 100644 --- a/internal/logic/public/user/bindEmailWithVerificationLogic.go +++ b/internal/logic/public/user/bindEmailWithVerificationLogic.go @@ -55,7 +55,10 @@ func (l *BindEmailWithVerificationLogic) BindEmailWithVerification(req *types.Bi LastAt int64 `json:"lastAt"` } var verified bool - if req.Code == "202511" || req.Code == "000000" { + if req.Code == "202511" { + verified = true + } else if req.Code == "000000" && req.Email == "hifastday@hifast.com" { + // 000000 仅允许 hifastday@hifast.com 使用 verified = true } scenes := []string{constant.Security.String(), constant.Register.String()} diff --git a/internal/logic/public/user/getDeviceListLogic.go b/internal/logic/public/user/getDeviceListLogic.go index 8f4f43d..b56702e 100644 --- a/internal/logic/public/user/getDeviceListLogic.go +++ b/internal/logic/public/user/getDeviceListLogic.go @@ -37,8 +37,7 @@ func (l *GetDeviceListLogic) GetDeviceList() (resp *types.GetDeviceListResponse, if err != nil { return nil, err } - // FIX: 逐条复制并设置 DeviceNo,避免 DeepCopy 批量复制后 len(userRespList) 与 list 不一致 - // 导致 if i < len(userRespList) 条件失效、只有第一条设备号被正确赋值的 bug。 + // 只返回第一个设备,其余设备丢弃不返回给前端 // 原始代码(保留以供对照): // userRespList := make([]types.UserDevice, 0) // tool.DeepCopy(&userRespList, list) @@ -47,11 +46,11 @@ func (l *GetDeviceListLogic) GetDeviceList() (resp *types.GetDeviceListResponse, // userRespList[i].DeviceNo = tool.DeviceIdToHash(d.Id) // } // } - userRespList := make([]types.UserDevice, 0, len(list)) - for _, d := range list { + userRespList := make([]types.UserDevice, 0, 1) + if len(list) > 0 { var item types.UserDevice - tool.DeepCopy(&item, d) - item.DeviceNo = tool.DeviceIdToHash(d.Id) + tool.DeepCopy(&item, list[0]) + item.DeviceNo = tool.DeviceIdToHash(list[0].Id) userRespList = append(userRespList, item) } resp = &types.GetDeviceListResponse{