From a72cd29baa743573ce07f7006afafc72a11cc290 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Fri, 31 Mar 2023 17:29:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tik_tok/svc_tik_tok_auth.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tik_tok/svc_tik_tok_auth.go b/tik_tok/svc_tik_tok_auth.go index 5af8c85..aa75969 100644 --- a/tik_tok/svc_tik_tok_auth.go +++ b/tik_tok/svc_tik_tok_auth.go @@ -14,11 +14,13 @@ func FirstAuth(args map[string]string) map[string]string { if err != nil { return data } - endTime := time.Now().Unix() + gjson.Get(send, "data.expires_in").Int() - 10 + endTime := time.Now().Unix() + gjson.Get(send, "data.expires_in").Int() + refreshEndTime := time.Now().Unix() + gjson.Get(send, "data.refresh_expires_in").Int() data = map[string]string{ - "tik_tok_acc_token": gjson.Get(send, "data.access_token").String(), - "tik_tok_acc_token_time": zhios_third_party_utils.Int64ToStr(endTime), - "tik_tok_acc_refresh_token": gjson.Get(send, "data.refresh_token").String(), + "tik_tok_acc_token": gjson.Get(send, "data.access_token").String(), + "tik_tok_acc_token_time": zhios_third_party_utils.Int64ToStr(endTime), + "tik_tok_acc_refresh_token_time": zhios_third_party_utils.Int64ToStr(refreshEndTime), + "tik_tok_acc_refresh_token": gjson.Get(send, "data.refresh_token").String(), } return data } @@ -29,7 +31,7 @@ func RefreshAuth(args map[string]string) map[string]string { if err != nil { return data } - endTime := time.Now().Unix() + gjson.Get(send, "data.expires_in").Int() - 10 + endTime := time.Now().Unix() + gjson.Get(send, "data.expires_in").Int() data = map[string]string{ "tik_tok_acc_token": gjson.Get(send, "data.access_token").String(), "tik_tok_acc_token_time": zhios_third_party_utils.Int64ToStr(endTime),