京东商城订单取手机号修改mobile

This commit is contained in:
苏尹岚
2020-06-18 08:36:38 +08:00
parent ffd67da56d
commit 9ac36d1e14
2 changed files with 6 additions and 14 deletions

View File

@@ -451,10 +451,10 @@ func (a *API) PhoneSensltiveInfo(orderId, accessKey string) (fakeMobile string,
"token": JdsMobileToken, "token": JdsMobileToken,
}, true) }, true)
if err == nil { if err == nil {
if result["model"].(map[string]interface{})["phone"] == nil { if result["model"].(map[string]interface{})["mobile"] == nil {
fakeMobile = result["model"].(map[string]interface{})["mobile"].(string)
} else {
fakeMobile = result["model"].(map[string]interface{})["phone"].(string) fakeMobile = result["model"].(map[string]interface{})["phone"].(string)
} else {
fakeMobile = result["model"].(map[string]interface{})["mobile"].(string)
} }
} }
return fakeMobile, err return fakeMobile, err

View File

@@ -6,7 +6,6 @@ import (
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"strings"
"testing" "testing"
"git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/baseapi/utils"
@@ -79,7 +78,7 @@ func TestOrderDetail(t *testing.T) {
} }
func TestPhoneSensltiveInfo(t *testing.T) { func TestPhoneSensltiveInfo(t *testing.T) {
result, err := api.PhoneSensltiveInfo("122792618177", "1e608a10060e75be7fc6c85645d6b2b7") result, err := api.PhoneSensltiveInfo("124396047880", "10b1707dc87755373d488a7a4f422f7d")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
@@ -103,15 +102,8 @@ func TestTryGetCookie(t *testing.T) {
} }
func TestAAADS(t *testing.T) { func TestAAADS(t *testing.T) {
var s = ` <td class="pubwhite">配送日期:</td> //c5MSDWxbgDc698slnUlR1w==
<td colspan="2">2020-06-17,13:00-14:00</td> fmt.Println(DecryptDESECB([]byte("Av3VLNsKfmmGw70Wiw7Qdw=="), []byte(JdsMobileKey)))
`
expectedDeliveredTime2 := regexpOrderDetailDay2.FindStringSubmatch(s)
if len(expectedDeliveredTime2) > 0 {
times := strings.Split(expectedDeliveredTime2[1], ",")
ss := times[0] + " " + times[1][:strings.Index(times[1], ":")] + ":00:00"
fmt.Println(ss)
}
} }
func DecryptDESECB(d, key []byte) string { func DecryptDESECB(d, key []byte) string {