tt
This commit is contained in:
@@ -36,7 +36,7 @@ func (a *API) AccessAPI2(url string, params map[string]interface{}) (retVal map[
|
|||||||
}
|
}
|
||||||
err = platformapi.AccessPlatformAPIWithRetry(a.client,
|
err = platformapi.AccessPlatformAPIWithRetry(a.client,
|
||||||
func() *http.Request {
|
func() *http.Request {
|
||||||
request, _ := http.NewRequest(http.MethodGet, url, strings.NewReader(string(data)))
|
request, _ := http.NewRequest(http.MethodPost, url, strings.NewReader(string(data)))
|
||||||
request.Header.Set("Content-Type", "application/json")
|
request.Header.Set("Content-Type", "application/json")
|
||||||
return request
|
return request
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ func TestCode2(t *testing.T) {
|
|||||||
|
|
||||||
func TestCode343(t *testing.T) {
|
func TestCode343(t *testing.T) {
|
||||||
a := New("5c8492ec2744fb72bb6cc356983f3cfc317f85d4", "ttaceeda5333d7a7ab01")
|
a := New("5c8492ec2744fb72bb6cc356983f3cfc317f85d4", "ttaceeda5333d7a7ab01")
|
||||||
data, err := a.GetTiktokOauth("0G3WBJXM4kuYlM0UmbRsrg9Bx_7YOQJflKewL6F7qe5aQDoy9j2mxgigESyPMlXzPNnvYsn1Swix-3pabUfqS-_2_H3WzOI6aeU_bSW10LzA-gq-8j797BU4iL0")
|
data, err := a.GetTiktokOauth("ghUxJ6g1xQbW6_rfnoTRlHUnWZ2THaPXJuxekaQ0-kz_5gw-94onRi982egQshVtaS3Nl5tLj929_1BVBmO3hm0JHJqdj9MDUloLSBBXSn-j0sX0DA6JPOyCaFM&ttaceeda5333d7a7ab01")
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
fmt.Println(data)
|
fmt.Println(data)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,15 +3,18 @@ package tiktok
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
|
"git.rosy.net.cn/jx-callback/globals"
|
||||||
)
|
)
|
||||||
|
|
||||||
// 获取抖音登录授权2
|
// 获取抖音登录授权2
|
||||||
func (a *API) GetTiktokOauth(code string) (*TiktokOauthResone, error) {
|
func (a *API) GetTiktokOauth(code string) (*TiktokOauthResone, error) {
|
||||||
|
globals.SugarLogger.Debug("初始code=============", code)
|
||||||
tokenReq := make(map[string]interface{}, 3)
|
tokenReq := make(map[string]interface{}, 3)
|
||||||
tokenReq["appid"] = a.GetAppID()
|
tokenReq["appid"] = a.GetAppID()
|
||||||
tokenReq["code"] = code
|
tokenReq["code"] = code
|
||||||
tokenReq["secret"] = a.GetSecret()
|
tokenReq["secret"] = a.GetSecret()
|
||||||
tokenReq["anonymous_code"] = ""
|
tokenReq["anonymous_code"] = ""
|
||||||
|
|
||||||
result, err := a.AccessAPI2(GetTiktokOauth, tokenReq)
|
result, err := a.AccessAPI2(GetTiktokOauth, tokenReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
Reference in New Issue
Block a user