This commit is contained in:
@@ -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()}
|
||||
|
||||
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user