Browse Source

修复富宝bug

tuoling805 1 year ago
parent
commit
4d1e3fd685
1 changed files with 2 additions and 9 deletions
  1. 2 9
      controllers/base_from_fubao.go

+ 2 - 9
controllers/base_from_fubao.go

@@ -57,15 +57,8 @@ func (this *FuBaoController) Add() {
 		}
 		if len(dataItem.ReturnValue.Data) > 0 {
 			priceStr := dataItem.ReturnValue.Data[0].PriceStr
-
-			priceArr := strings.Split(priceStr, "-")
-			var isAdd bool
-			for _, v := range priceArr {
-				if v == "" {
-					isAdd = true
-				}
-			}
-			if isAdd == false {
+			strIndex := strings.Index(priceStr, "-")
+			if strIndex > 0 {
 				br.Msg = "此指标的数据格式暂不支持!"
 				br.ErrMsg = "此指标的数据格式暂不支持,Val:" + priceStr + ";pid:" + req.EdbCode
 				return