View Source WeChat.Refresher.DefaultSettings (wechat v0.16.0)

刷新 AccessToken 的方法

Summary

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

Link to this function

component_refresh_options(client)

View Source
@spec component_refresh_options(WeChat.client()) :: refresh_options()

输出[第三方平台]的 refresh_options

刷新如下 AccessToken

  • component_access_token
  • AuthorizerRefreshOptions (get by client.app_type())
Link to this function

get_refresh_options_by_client(client)

View Source
@spec get_refresh_options_by_client(WeChat.client()) :: refresh_options()

根据不同的 clientapp_type & by_component? 输出不同的 refresh_options

rules:

Link to this function

mini_program_refresh_options(client)

View Source
@spec mini_program_refresh_options(WeChat.Work.client()) :: refresh_options()

输出[小程序]的 refresh_options

刷新如下 AccessToken

  • access_token
Link to this function

official_account_refresh_options(client)

View Source
@spec official_account_refresh_options(WeChat.client()) :: refresh_options()

输出[公众号]的 refresh_options

刷新如下 AccessToken

  • access_token
  • js_api_ticket
  • wx_card_ticket
Link to this function

refresh_access_token(client)

View Source
@spec refresh_access_token(WeChat.client()) :: refresh_fun_result()
Link to this function

refresh_authorizer_access_token(client)

View Source
@spec refresh_authorizer_access_token(WeChat.client()) :: refresh_fun_result()
Link to this function

refresh_component_access_token(client)

View Source
@spec refresh_component_access_token(WeChat.client()) :: refresh_fun_result()
Link to this function

refresh_mini_program_access_token(client)

View Source
@spec refresh_mini_program_access_token(WeChat.client()) :: refresh_fun_result()
Link to this function

refresh_ticket(ticket_type, client)

View Source
Link to this function

refresh_work_access_token(client, cache_id, agent_id)

View Source
Link to this function

refresh_work_jsapi_ticket(client, cache_id, agent_id, store_key, is_agent)

View Source
Link to this function

work_refresh_options(client)

View Source
@spec work_refresh_options(WeChat.client()) :: refresh_options()

输出[企业微信]的 refresh_options

刷新如下 AccessToken

  • access_token
Link to this function

work_refresh_options(client, agent)

View Source
@spec work_refresh_options(WeChat.client(), WeChat.Work.Agent.t()) ::
  refresh_options()