Browse Source

更新

master
huangjiajun 1 year ago
parent
commit
a72cd29baa
1 changed files with 7 additions and 5 deletions
  1. +7
    -5
      tik_tok/svc_tik_tok_auth.go

+ 7
- 5
tik_tok/svc_tik_tok_auth.go View File

@@ -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),


Loading…
Cancel
Save