This commit is contained in:
richboo111
2022-08-19 15:29:13 +08:00
parent 104c6f7a60
commit d4c1f64201
3 changed files with 16 additions and 12 deletions

View File

@@ -32,8 +32,11 @@ func (a *API) Sign(paramsMap map[string]interface{}) string {
paramsArr = append(paramsArr, value)
}
}
paramsArr = append(paramsArr, salt)
if a.clientKey == TiktokJXDJAppID {
paramsArr = append(paramsArr, salt2)
} else {
paramsArr = append(paramsArr, salt)
}
sort.Strings(paramsArr)
return fmt.Sprintf("%x", md5.Sum([]byte(strings.Join(paramsArr, "&"))))
}
@@ -59,8 +62,8 @@ func (a *API) CreateOrderByTicktock(param *TickTokCreateOrder) (string, string,
// 获取抖音token
func (a *API) GetTiktokToken() error {
tokenReq := make(map[string]interface{}, 3)
tokenReq["appid"] = TiktokJXDJAppID
tokenReq["secret"] = TiktokJXDJSecret
tokenReq["appid"] = a.clientKey
tokenReq["secret"] = a.clientSecret
//tokenReq["appid"] = TiktokAppId
//tokenReq["secret"] = TiktokSecret
tokenReq["grant_type"] = "client_credential"