From 4af82484329cc603ce8557cb764998ef83266836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 23 Jun 2020 09:30:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=AC=E4=B8=9C=E5=95=86=E5=9F=8E=E9=A2=84?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platformapi/jdshopapi/jxshopapi_test.go | 2 +- platformapi/jdshopapi/store_page.go | 4 +++- platformapi/jdshopapi/store_page_test.go | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/platformapi/jdshopapi/jxshopapi_test.go b/platformapi/jdshopapi/jxshopapi_test.go index d4dfbcd9..83b3fe1c 100644 --- a/platformapi/jdshopapi/jxshopapi_test.go +++ b/platformapi/jdshopapi/jxshopapi_test.go @@ -16,6 +16,6 @@ func init() { baseapi.Init(sugarLogger) api = New("de8157b447584885910f429011e49cb93yjq", "E1D746D42474D5F1F1A10CECE75D99F6", "efa7e1d1a22640fa990e6cf164b28608") api.SetCookieWithStr(` - thor=80FAF09E9A09B6E618A68057BDFCFCB82CCFD5645F40A144C6CA92A0B84FE8EFE9869C996F2E8961897A27841241639DB35880508820C0CA9E10513471C69F54E4AB811C98D045B848501CAE165D62FEC731B43499E9A86C821179ED3A0B2D683E5472D06BF5D30DC8D029682A30858FC22FC228246002C368B0A689F25113A240E0B8EDB9D8C99915526D3E34C84A82; + thor=00513FC363111586B2C0E065A90E33C1284E5BA68461D5ACC9B4830A54FE27F559AB1D4D2F6FBCD3F6FC99402F2C7C6CC65751CB0BB5AB39CBC12EFE762024EAFEC90B6F414373DDD6B07D72367A45E79C72A12A2B87F158020FA41387E6D34FF3BA71F33342994A47217C3D1C753CC79B6A98E8F78935F09D50A2AFDF34F666FAB9C0D159B6FCE72CAA929B8420F419; `) } diff --git a/platformapi/jdshopapi/store_page.go b/platformapi/jdshopapi/store_page.go index 08340804..b55fdca2 100644 --- a/platformapi/jdshopapi/store_page.go +++ b/platformapi/jdshopapi/store_page.go @@ -6,6 +6,7 @@ import ( "net/http" "regexp" "strings" + "time" "git.rosy.net.cn/baseapi" "git.rosy.net.cn/baseapi/platformapi" @@ -421,7 +422,8 @@ func (a *API) OrderDetail(orderId string) (orderDetailResult *OrderDetailResult, } } if len(expectedDeliveredTime) > 0 { - orderDetailResult.ExpectedDeliveredTime = expectedDeliveredTime[1][strings.LastIndex(expectedDeliveredTime[1], "-")+1:] + ":00" + expectedDeliveredTime := expectedDeliveredTime[1][:strings.LastIndex(expectedDeliveredTime[1], "-")] + ":00" + orderDetailResult.ExpectedDeliveredTime = utils.Time2Str(utils.Str2Time(expectedDeliveredTime).Add(50 * time.Minute)) } else { expectedDeliveredTime2 := regexpOrderDetailDay2.FindStringSubmatch(body) if len(expectedDeliveredTime2) > 0 { diff --git a/platformapi/jdshopapi/store_page_test.go b/platformapi/jdshopapi/store_page_test.go index 79e4454a..daa07f2e 100644 --- a/platformapi/jdshopapi/store_page_test.go +++ b/platformapi/jdshopapi/store_page_test.go @@ -71,7 +71,7 @@ func TestAllOrders(t *testing.T) { } func TestOrderDetail(t *testing.T) { - result, err := api.OrderDetail("124350112427") + result, err := api.OrderDetail("125138699851") if err != nil { t.Fatal(err) }