🐛 修复返回数据错误

This commit is contained in:
孙晓龙
2024-06-27 09:33:42 +08:00
committed by sunxiaolong
parent 488d372845
commit bd413d0c6a
2 changed files with 3 additions and 3 deletions

View File

@@ -188,15 +188,15 @@ func (c *ScanController) GetAllowedMM() {
LinkID string `json:"linkID" description:"链接"`
}
resData := make(map[string]profitMarginStruct, len(profitMarginList))
resData := make([]profitMarginStruct, len(profitMarginList))
for _, v := range profitMarginList {
resData[strconv.FormatFloat(v.FactLabel, 'f', 0, 64)] = profitMarginStruct{
resData = append(resData, profitMarginStruct{
FactLabel: v.FactLabel,
ShowLabel: v.ShowLabel,
PlatformLabel: v.PlatformLabel,
IsLinkSingle: v.IsLinkSingle,
LinkID: v.LinkID,
}
})
}
c.Data["json"] = response.Ok(resData)
_ = c.ServeJSON()