ソースを参照

fix:优化处理

duxin 3 年 前
コミット
5d737251aa
1 ファイル変更3 行追加2 行削除
  1. 3 2
      handler/activity/lotteryService.go

+ 3 - 2
handler/activity/lotteryService.go

@@ -128,9 +128,10 @@ func getLotteryReceive(lotteryRep config.LotteryReceiveReq) (int, string) {
 	defer resp.Body.Close()
 	var info map[string]interface{}
 	result, _ := ioutil.ReadAll(resp.Body)
-	if err = json.Unmarshal(result, &info); err == nil {
-		fmt.Println("==============json str 转map=======================", info)
+	if err = json.Unmarshal(result, &info); err != nil {
+		return 0, err.Error()
 	}
+	fmt.Println("==============json str 转map=======================", info)
 	codeInt, err2 := strconv.Atoi(fmt.Sprint(info["Code"]))
 	if err2 != nil {
 		return 0, err2.Error()