淘宝联盟

This commit is contained in:
suyl
2021-04-25 17:22:10 +08:00
parent d23bba1392
commit 88a657ba9e
9 changed files with 380 additions and 14 deletions

View File

@@ -3,16 +3,13 @@ package jdshopapi
import (
"crypto/aes"
"crypto/cipher"
"crypto/md5"
"encoding/binary"
"encoding/base64"
"fmt"
"git.rosy.net.cn/baseapi/utils"
"math"
"sort"
"strings"
"testing"
"time"
"git.rosy.net.cn/baseapi/utils"
)
func TestCreateShopCategory(t *testing.T) {
@@ -105,12 +102,11 @@ func TestTryGetCookie(t *testing.T) {
}
func TestAAADS(t *testing.T) {
now := time.Now().Unix()
fmt.Println(utils.Int64ToStr(now))
result := md5.Sum([]byte("2108849168000062" + utils.Int64ToStr(now)))
chanIndex := int(int64(binary.LittleEndian.Uint32(result[8:])) % int64(2000))
fmt.Println(chanIndex)
key, _ := base64.StdEncoding.DecodeString("DW+rL8hlSFt65gUnDXW13A==")
data, _ := base64.StdEncoding.DecodeString("Zh1/Gnb3GWkt7slPocCh5EjgfCrivUMrEjQZT+ND2fsDZYGXIny8NazZJ7UA8DgMpuJf9vBPlf3C8l8oT7aYebJMhAEx8kRFdQip8yEFqbzTfHfnNnMsI4Wkh1Ij06iLiZITnPUdWsuHjwI7BKKmZFDloiOkn3p+gtACFThm7B03SfPmvOdokdIQvDa1nEzPL/2DkfhAwDPxzgGHI0HaAQ==")
iv, _ := base64.StdEncoding.DecodeString("BBYl0UZhgnV59eP6MkxeeQ==")
result, _ := Decrypt(data, key, iv)
fmt.Println(string(result))
}
func Decrypt(decryptBytes, key, iv []byte) ([]byte, error) {
@@ -205,7 +201,7 @@ func TestUpdateBasic(t *testing.T) {
func TestUpdateExpand(t *testing.T) {
str := "https://wx.jxc4.com/jxcsRegist?mobile=15520595380"
fmt.Println(str[:strings.LastIndex(str,"?")])
fmt.Println(str[:strings.LastIndex(str, "?")])
}
func TestCreateGisFence(t *testing.T) {