更新 .tool-versions 文件,将 Golang 版本从 1.24.2 升级至 1.24.3;在 eggplant.go 文件中,新增对特定订单状态的处理逻辑,增强错误处理能力,提升系统稳定性。

This commit is contained in:
danial
2025-05-07 23:21:44 +08:00
parent 198489574a
commit b22f38817a
2 changed files with 5 additions and 2 deletions

View File

@@ -1 +1 @@
golang 1.24.2
golang 1.24.3

View File

@@ -22,6 +22,7 @@ import (
"slices"
"sort"
"strconv"
"strings"
"time"
"github.com/beego/beego/v2/client/httplib"
@@ -195,7 +196,9 @@ func (c *eggplantProductCode) channelTwo(ctx context.Context, forwardUrl *url.UR
if respData.Code == 500 && respData.Msg == "订单不可用" {
return true, fmt.Sprintf("%s按照订单正常处理", respData.Msg), ""
}
if respData.Code == 1 && strings.Contains(respData.Msg, "该订单号") && strings.Contains(respData.Msg, "已成功") {
return true, fmt.Sprintf("%s按照订单正常处理", respData.Msg), ""
}
if respData.Code != 0 {
return false, respData.Msg, ""
}