From 84a7b953becfc2a2dad70897f29e92374fc5afa9 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Fri, 24 Feb 2023 16:42:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- macao_logistics/macao_logistics.go | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/macao_logistics/macao_logistics.go b/macao_logistics/macao_logistics.go index 34b0795..d86a0b4 100644 --- a/macao_logistics/macao_logistics.go +++ b/macao_logistics/macao_logistics.go @@ -30,6 +30,9 @@ func GetGoods(params map[string]interface{}, acctoken string) string { fmt.Println("macap1:" + err.Error()) return "" } + if gjson.Get(send, "code").Int() == 402 && gjson.Get(send, "msg").String() == "Token校驗失敗" || gjson.Get(send, "msg").String() == "Token\\u6821\\u9a57\\u5931\\u6557" { + return "token校验失败" + } return gjson.Get(send, "data.data").String() } func GetStore(params map[string]interface{}, acctoken string) string { @@ -41,6 +44,9 @@ func GetStore(params map[string]interface{}, acctoken string) string { fmt.Println("macap1:" + err.Error()) return "" } + if gjson.Get(send, "code").Int() == 402 && gjson.Get(send, "msg").String() == "Token校驗失敗" || gjson.Get(send, "msg").String() == "Token\\u6821\\u9a57\\u5931\\u6557" { + return "token校验失败" + } return gjson.Get(send, "data.data").String() } func GetOrder(params map[string]interface{}, acctoken string) string { @@ -52,6 +58,9 @@ func GetOrder(params map[string]interface{}, acctoken string) string { fmt.Println("macap1:" + err.Error()) return "" } + if gjson.Get(send, "code").Int() == 402 && gjson.Get(send, "msg").String() == "Token校驗失敗" || gjson.Get(send, "msg").String() == "Token\\u6821\\u9a57\\u5931\\u6557" { + return "token校验失败" + } return gjson.Get(send, "data.data").String() } func RegUser(params map[string]interface{}) string { @@ -62,14 +71,17 @@ func RegUser(params map[string]interface{}) string { fmt.Println(string(data)) return string(data) } -func RegUserNew(params map[string]interface{}) string { - send, err := Send("/jyb/user/v2/register", params, "b7451652b079734ed35e1c36eaca40e6") +func RegUserNew(params map[string]interface{}, acctoken string) string { + send, err := Send("/jyb/user/v2/register", params, acctoken) fmt.Println("macap1:", params) fmt.Println("macap1:" + send) if err != nil { fmt.Println("macap1:" + err.Error()) return "" } + if gjson.Get(send, "code").Int() == 402 && gjson.Get(send, "msg").String() == "Token校驗失敗" || gjson.Get(send, "msg").String() == "Token\\u6821\\u9a57\\u5931\\u6557" { + return "token校验失败" + } return send } @@ -81,5 +93,8 @@ func GetAddress(params map[string]interface{}, acctoken string) string { fmt.Println("macap1:" + err.Error()) return "" } + if gjson.Get(send, "code").Int() == 402 && gjson.Get(send, "msg").String() == "Token校驗失敗" || gjson.Get(send, "msg").String() == "Token\\u6821\\u9a57\\u5931\\u6557" { + return "token校验失败" + } return gjson.Get(send, "data").String() }