tt
This commit is contained in:
@@ -12,7 +12,8 @@ const (
|
|||||||
TiktokTokenUrl = "oauth/access_token/"
|
TiktokTokenUrl = "oauth/access_token/"
|
||||||
TiktokRefreshTokenUrl = "oauth/renew_refresh_token/"
|
TiktokRefreshTokenUrl = "oauth/renew_refresh_token/"
|
||||||
|
|
||||||
salt = "TUsUuzcfWriQ8ZXUQOrxPcScjEGlgMSjJaDMCtVy"
|
salt = "TUsUuzcfWriQ8ZXUQOrxPcScjEGlgMSjJaDMCtVy" //京西菜市
|
||||||
|
salt2 = "Ab25GOMdO2FukyGvgW8HtEzwQtBgNak6ffKUyebD" //京西到家
|
||||||
ResponseCodeSuccess = "SUCCESS"
|
ResponseCodeSuccess = "SUCCESS"
|
||||||
ResponseCodeFail = "FAIL"
|
ResponseCodeFail = "FAIL"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -32,8 +32,11 @@ func (a *API) Sign(paramsMap map[string]interface{}) string {
|
|||||||
paramsArr = append(paramsArr, value)
|
paramsArr = append(paramsArr, value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if a.clientKey == TiktokJXDJAppID {
|
||||||
paramsArr = append(paramsArr, salt)
|
paramsArr = append(paramsArr, salt2)
|
||||||
|
} else {
|
||||||
|
paramsArr = append(paramsArr, salt)
|
||||||
|
}
|
||||||
sort.Strings(paramsArr)
|
sort.Strings(paramsArr)
|
||||||
return fmt.Sprintf("%x", md5.Sum([]byte(strings.Join(paramsArr, "&"))))
|
return fmt.Sprintf("%x", md5.Sum([]byte(strings.Join(paramsArr, "&"))))
|
||||||
}
|
}
|
||||||
@@ -59,8 +62,8 @@ func (a *API) CreateOrderByTicktock(param *TickTokCreateOrder) (string, string,
|
|||||||
// 获取抖音token
|
// 获取抖音token
|
||||||
func (a *API) GetTiktokToken() error {
|
func (a *API) GetTiktokToken() error {
|
||||||
tokenReq := make(map[string]interface{}, 3)
|
tokenReq := make(map[string]interface{}, 3)
|
||||||
tokenReq["appid"] = TiktokJXDJAppID
|
tokenReq["appid"] = a.clientKey
|
||||||
tokenReq["secret"] = TiktokJXDJSecret
|
tokenReq["secret"] = a.clientSecret
|
||||||
//tokenReq["appid"] = TiktokAppId
|
//tokenReq["appid"] = TiktokAppId
|
||||||
//tokenReq["secret"] = TiktokSecret
|
//tokenReq["secret"] = TiktokSecret
|
||||||
tokenReq["grant_type"] = "client_credential"
|
tokenReq["grant_type"] = "client_credential"
|
||||||
|
|||||||
@@ -40,12 +40,12 @@ func TestCode343(t *testing.T) {
|
|||||||
fmt.Println(data)
|
fmt.Println(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestCode343(t *testing.T) {
|
//func TestCode343(t *testing.T) {
|
||||||
a := New("5c8492ec2744fb72bb6cc356983f3cfc317f85d4", "ttaceeda5333d7a7ab01")
|
// a := New("5c8492ec2744fb72bb6cc356983f3cfc317f85d4", "ttaceeda5333d7a7ab01")
|
||||||
data, err := a.GetTiktokOauth("-j_QmmDM7B-mjKKk9wcijMeUTAV75mNXbJI4rqabt1IMkDGEmmw1M0-azYJwoXNOrWaDeXlw4xNivEd-uobXuuZrtt7bNn-6AMzf8jvkXp6Jm3LPcP56KisO9w4")
|
// data, err := a.GetTiktokOauth("-j_QmmDM7B-mjKKk9wcijMeUTAV75mNXbJI4rqabt1IMkDGEmmw1M0-azYJwoXNOrWaDeXlw4xNivEd-uobXuuZrtt7bNn-6AMzf8jvkXp6Jm3LPcP56KisO9w4")
|
||||||
fmt.Println(err)
|
// fmt.Println(err)
|
||||||
fmt.Println(data)
|
// fmt.Println(data)
|
||||||
}
|
//}
|
||||||
|
|
||||||
func TestCode22(t *testing.T) {
|
func TestCode22(t *testing.T) {
|
||||||
fmt.Println(2&4 != 0)
|
fmt.Println(2&4 != 0)
|
||||||
@@ -59,7 +59,7 @@ func TestCode22(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestGetToken(t *testing.T) {
|
func TestGetToken(t *testing.T) {
|
||||||
a := New("5c08a0465cf0f996af254a03b6c2548defef87ad", "tta6a1d01c399f264201")
|
a := New("5c8492ec2744fb72bb6cc356983f3cfc317f85d4", "ttaceeda5333d7a7ab01")
|
||||||
//a := New("5c08a0465cf0f996af254a03b6c2548defef87ad", "tta6a1d01c399f264201")
|
//a := New("5c08a0465cf0f996af254a03b6c2548defef87ad", "tta6a1d01c399f264201")
|
||||||
err := a.GetTiktokToken()
|
err := a.GetTiktokToken()
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
|
|||||||
Reference in New Issue
Block a user