huangjiajun před 1 rokem
rodič
revize
a72cd29baa
1 změnil soubory, kde provedl 7 přidání a 5 odebrání
  1. +7
    -5
      tik_tok/svc_tik_tok_auth.go

+ 7
- 5
tik_tok/svc_tik_tok_auth.go Zobrazit soubor

@@ -14,11 +14,13 @@ func FirstAuth(args map[string]string) map[string]string {
if err != nil { if err != nil {
return data 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{ 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 return data
} }
@@ -29,7 +31,7 @@ func RefreshAuth(args map[string]string) map[string]string {
if err != nil { if err != nil {
return data 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{ data = map[string]string{
"tik_tok_acc_token": gjson.Get(send, "data.access_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_token_time": zhios_third_party_utils.Int64ToStr(endTime),


Načítá se…
Zrušit
Uložit