Explorar o código

ratio must gte 0

liuzhifei hai 1 ano
pai
achega
3d33079de0

+ 1 - 1
common/group-ratio.go

@@ -35,7 +35,7 @@ func GetGroupRatio(name string) float64 {
 
 func CheckGroupRatio(jsonStr string) error {
 	checkGroupRatio := make(map[string]float64)
-	err := json.Unmarshal([]byte(jsonStr), &GroupRatio)
+	err := json.Unmarshal([]byte(jsonStr), &checkGroupRatio)
 	if err != nil {
 		return err
 	}

+ 5 - 3
web/src/pages/Setting/Operation/SettingsMagnification.js

@@ -51,14 +51,16 @@ export default function SettingsMagnification(props) {
                 return showError('部分保存失败,请重试');
             }
             for (let i = 0; i < res.length; i++) {
-              if (!res[i].success) {
-                return showError(res[i].message)
+              if (!res[i].data.success) {
+                return showError(res[i].data.message)
               }
             }
             showSuccess('保存成功');
             props.refresh();
           })
-          .catch(() => {
+          .catch(error => {
+            console.error('Unexpected error in Promise.all:', error);
+
             showError('保存失败,请重试');
           })
           .finally(() => {