View Source WeChat.Refresher.DefaultSettings (wechat v0.16.0)
刷新 AccessToken
的方法
Summary
Functions
输出[第三方平台]的 refresh_options
根据不同的 client
的 app_type
& by_component?
输出不同的 refresh_options
输出[小程序]的 refresh_options
输出[公众号]的 refresh_options
输出[企业微信]的 refresh_options
Types
@type expires_in() :: non_neg_integer()
@type key_name() :: atom()
@type refresh_fun() :: (WeChat.client() -> refresh_fun_result())
@type refresh_fun_result() :: {:ok, token(), expires_in()} | {:ok, token_list(), expires_in()} | {:error, any()}
@type refresh_option() :: {WeChat.Storage.Adapter.store_id(), key_name(), refresh_fun()}
@type refresh_options() :: [refresh_option()]
@type token() :: String.t()
@type token_list() :: [{key_name(), token(), expires_in()}]
Functions
@spec component_refresh_options(WeChat.client()) :: refresh_options()
输出[第三方平台]的 refresh_options
刷新如下 AccessToken
:
component_access_token
- AuthorizerRefreshOptions (get by client.app_type())
@spec get_refresh_options_by_client(WeChat.client()) :: refresh_options()
根据不同的 client
的 app_type
& by_component?
输出不同的 refresh_options
rules:
by_component?
==true
:component_refresh_options/1
official_account
:official_account_refresh_options/1
mini_program
:mini_program_refresh_options/1
@spec mini_program_refresh_options(WeChat.Work.client()) :: refresh_options()
输出[小程序]的 refresh_options
刷新如下 AccessToken
:
access_token
@spec official_account_refresh_options(WeChat.client()) :: refresh_options()
输出[公众号]的 refresh_options
刷新如下 AccessToken
:
access_token
js_api_ticket
wx_card_ticket
@spec refresh_access_token(WeChat.client()) :: refresh_fun_result()
@spec refresh_authorizer_access_token(WeChat.client()) :: refresh_fun_result()
@spec refresh_component_access_token(WeChat.client()) :: refresh_fun_result()
@spec refresh_mini_program_access_token(WeChat.client()) :: refresh_fun_result()
@spec refresh_ticket(WeChat.WebPage.js_api_ticket_type(), WeChat.client()) :: refresh_fun_result()
@spec refresh_work_access_token( WeChat.Work.client(), WeChat.Storage.Cache.cache_id(), WeChat.Work.agent_id() ) :: refresh_fun_result()
Link to this function
refresh_work_jsapi_ticket(client, cache_id, agent_id, store_key, is_agent)
View Source@spec refresh_work_jsapi_ticket( WeChat.Work.client(), WeChat.Storage.Cache.cache_id(), WeChat.Work.agent_id(), WeChat.Storage.Cache.cache_sub_key(), is_agent :: boolean() ) :: refresh_fun_result()
@spec work_refresh_options(WeChat.client()) :: refresh_options()
输出[企业微信]的 refresh_options
刷新如下 AccessToken
:
access_token
@spec work_refresh_options(WeChat.client(), WeChat.Work.Agent.t()) :: refresh_options()