From 3be686ed83fe08bcc0a465d224f54267d3496164 Mon Sep 17 00:00:00 2001 From: baerwang <1780285721@qq.com> Date: Tue, 19 Apr 2022 06:10:35 +0800 Subject: [PATCH] fix:judge field exist --- main.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index db5ccbc..c9e128b 100644 --- a/main.go +++ b/main.go @@ -428,7 +428,7 @@ func reserveTime(products interface{}, aid string) map[string]int64 { reserved := make(map[string]int64, 3) reserved["reserved_time_start"] = item.StartTimestamp reserved["reserved_time_end"] = item.EndTimestamp - log.Println("更新配送时间成功 start ", item.StartTimestamp, " end ", item.EndTimestamp) + // log.Println("更新配送时间成功 start ", item.StartTimestamp, " end ", item.EndTimestamp) return reserved } } @@ -652,7 +652,11 @@ func submitOrder(aid string, cart map[string]interface{}, order map[string]inter // httpStatus judge http status func httpStatus(info map[string]interface{}, str string) bool { - if !info["success"].(bool) { + data, ok := info["success"].(bool) + if !ok { + return false + } + if !data { msg, ok := info["message"].(string) if ok { if "您的访问已过期" == msg {