This commit is contained in:
@@ -55,7 +55,10 @@ func (l *BindEmailWithVerificationLogic) BindEmailWithVerification(req *types.Bi
|
|||||||
LastAt int64 `json:"lastAt"`
|
LastAt int64 `json:"lastAt"`
|
||||||
}
|
}
|
||||||
var verified bool
|
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
|
verified = true
|
||||||
}
|
}
|
||||||
scenes := []string{constant.Security.String(), constant.Register.String()}
|
scenes := []string{constant.Security.String(), constant.Register.String()}
|
||||||
|
|||||||
@@ -37,8 +37,7 @@ func (l *GetDeviceListLogic) GetDeviceList() (resp *types.GetDeviceListResponse,
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
// FIX: 逐条复制并设置 DeviceNo,避免 DeepCopy 批量复制后 len(userRespList) 与 list 不一致
|
// 只返回第一个设备,其余设备丢弃不返回给前端
|
||||||
// 导致 if i < len(userRespList) 条件失效、只有第一条设备号被正确赋值的 bug。
|
|
||||||
// 原始代码(保留以供对照):
|
// 原始代码(保留以供对照):
|
||||||
// userRespList := make([]types.UserDevice, 0)
|
// userRespList := make([]types.UserDevice, 0)
|
||||||
// tool.DeepCopy(&userRespList, list)
|
// tool.DeepCopy(&userRespList, list)
|
||||||
@@ -47,11 +46,11 @@ func (l *GetDeviceListLogic) GetDeviceList() (resp *types.GetDeviceListResponse,
|
|||||||
// userRespList[i].DeviceNo = tool.DeviceIdToHash(d.Id)
|
// userRespList[i].DeviceNo = tool.DeviceIdToHash(d.Id)
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
userRespList := make([]types.UserDevice, 0, len(list))
|
userRespList := make([]types.UserDevice, 0, 1)
|
||||||
for _, d := range list {
|
if len(list) > 0 {
|
||||||
var item types.UserDevice
|
var item types.UserDevice
|
||||||
tool.DeepCopy(&item, d)
|
tool.DeepCopy(&item, list[0])
|
||||||
item.DeviceNo = tool.DeviceIdToHash(d.Id)
|
item.DeviceNo = tool.DeviceIdToHash(list[0].Id)
|
||||||
userRespList = append(userRespList, item)
|
userRespList = append(userRespList, item)
|
||||||
}
|
}
|
||||||
resp = &types.GetDeviceListResponse{
|
resp = &types.GetDeviceListResponse{
|
||||||
|
|||||||
Reference in New Issue
Block a user