美团配送cookie取消

This commit is contained in:
suyl
2020-05-31 10:29:34 +08:00
parent d29d80b808
commit 6c600ace7e
3 changed files with 25 additions and 14 deletions

View File

@@ -1,6 +1,8 @@
package jdapi package jdapi
import ( import (
"fmt"
"regexp"
"testing" "testing"
"time" "time"
@@ -151,3 +153,14 @@ func TestUpdateStoreFreightConfigNew(t *testing.T) {
t.Fatal(err) t.Fatal(err)
} }
} }
func TestAA(t *testing.T) {
str := "您的快件正在派送中请您准备签收快递员赵磊联系电话18884041675"
regexpCnameAndCmobile2 := regexp.MustCompile(`(快递员:(.*),联系电话:(.*)`)
result := regexpCnameAndCmobile2.FindAllStringSubmatch(str, -1)
if len(result) > 0 {
cName := result[0][1]
cMobile := result[0][2]
fmt.Println(cName, cMobile)
}
}

View File

@@ -47,7 +47,7 @@ func TestGetProvince(t *testing.T) {
} }
func TestGetCity(t *testing.T) { func TestGetCity(t *testing.T) {
result, err := api.GetCity(22) result, err := api.GetCity(2)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
@@ -55,7 +55,7 @@ func TestGetCity(t *testing.T) {
} }
func TestGetCounty(t *testing.T) { func TestGetCounty(t *testing.T) {
result, err := api.GetCounty(1930) result, err := api.GetCounty(2815)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }

View File

@@ -1,22 +1,20 @@
package mtpsapi package mtpsapi
import ( import (
"fmt"
"git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/baseapi/utils"
) )
func (a *API) PagePoiUpdate(outerPoiID, contactName, contactPhone, contactEmail string) (err error) { func (a *API) PagePoiUpdate(outerPoiID, contactName, contactPhone, contactEmail string) (err error) {
if outerPoiID == "" || contactName == "" || contactPhone == "" || contactEmail == "" { // if outerPoiID == "" || contactName == "" || contactPhone == "" || contactEmail == "" {
return fmt.Errorf("所有参数必须都要有值") // return fmt.Errorf("所有参数必须都要有值")
} // }
params := map[string]interface{}{ // params := map[string]interface{}{
"outerPoiId": outerPoiID, // "outerPoiId": outerPoiID,
"contactName": contactName, // "contactName": contactName,
"contactPhone": contactPhone, // "contactPhone": contactPhone,
"contactEmail": contactEmail, // "contactEmail": contactEmail,
} // }
_, err = a.AccessAPI2("https://page.peisong.meituan.com/api", "haikuiopen/haikui/open/partner/poi/update", params) // _, err = a.AccessAPI2("https://page.peisong.meituan.com/api", "haikuiopen/haikui/open/partner/poi/update", params)
return err return err
} }