|
@@ -225,7 +225,7 @@ func GetChanxuanToken() string { |
|
|
getString, err := cache.GetString(key) |
|
|
getString, err := cache.GetString(key) |
|
|
if err != nil || getString == "" { |
|
|
if err != nil || getString == "" { |
|
|
data := chanxuanTikTok.GetToken(tiktokChanxuanId, tiktokChanxuanSecret) |
|
|
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() |
|
|
token := gjson.Get(data, "access_token").String() |
|
|
if token != "" { |
|
|
if token != "" { |
|
|
cache.SetEx(key, token, int(ex)) |
|
|
cache.SetEx(key, token, int(ex)) |
|
|