Commit c9064de6 by liuzhifei

ratio must gte 0

parent 05db6660
...@@ -35,7 +35,7 @@ func GetGroupRatio(name string) float64 { ...@@ -35,7 +35,7 @@ func GetGroupRatio(name string) float64 {
func CheckGroupRatio(jsonStr string) error { func CheckGroupRatio(jsonStr string) error {
checkGroupRatio := make(map[string]float64) checkGroupRatio := make(map[string]float64)
err := json.Unmarshal([]byte(jsonStr), &GroupRatio) err := json.Unmarshal([]byte(jsonStr), &checkGroupRatio)
if err != nil { if err != nil {
return err return err
} }
......
...@@ -51,14 +51,16 @@ export default function SettingsMagnification(props) { ...@@ -51,14 +51,16 @@ export default function SettingsMagnification(props) {
return showError('部分保存失败,请重试'); return showError('部分保存失败,请重试');
} }
for (let i = 0; i < res.length; i++) { for (let i = 0; i < res.length; i++) {
if (!res[i].success) { if (!res[i].data.success) {
return showError(res[i].message) return showError(res[i].data.message)
} }
} }
showSuccess('保存成功'); showSuccess('保存成功');
props.refresh(); props.refresh();
}) })
.catch(() => { .catch(error => {
console.error('Unexpected error in Promise.all:', error);
showError('保存失败,请重试'); showError('保存失败,请重试');
}) })
.finally(() => { .finally(() => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment