瀏覽代碼

fix: fix group list not correct (close #147)

JustSong 2 年之前
父節點
當前提交
955d5f8707
共有 2 個文件被更改,包括 2 次插入0 次删除
  1. 1 0
      common/group-ratio.go
  2. 1 0
      common/model-ratio.go

+ 1 - 0
common/group-ratio.go

@@ -17,6 +17,7 @@ func GroupRatio2JSONString() string {
 }
 
 func UpdateGroupRatioByJSONString(jsonStr string) error {
+	GroupRatio = make(map[string]float64)
 	return json.Unmarshal([]byte(jsonStr), &GroupRatio)
 }
 

+ 1 - 0
common/model-ratio.go

@@ -39,6 +39,7 @@ func ModelRatio2JSONString() string {
 }
 
 func UpdateModelRatioByJSONString(jsonStr string) error {
+	ModelRatio = make(map[string]float64)
 	return json.Unmarshal([]byte(jsonStr), &ModelRatio)
 }