|
|
@@ -225,7 +225,7 @@ func GetChanxuanToken() string { |
|
|
|
getString, err := cache.GetString(key) |
|
|
|
if err != nil || getString == "" { |
|
|
|
data := chanxuanTikTok.GetToken(tiktokChanxuanId, tiktokChanxuanSecret) |
|
|
|
ex := gjson.Get(data, "expires_in_v2").Int() - time.Now().Unix() |
|
|
|
ex := gjson.Get(data, "expires_in_v2").Int() - time.Now().Unix() - 60 |
|
|
|
token := gjson.Get(data, "access_token").String() |
|
|
|
if token != "" { |
|
|
|
cache.SetEx(key, token, int(ex)) |
|
|
|