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

帮助模块: 输出刷新 token 的列表

Link to this section Summary

Link to this section Types

Specs

expires_in() :: non_neg_integer()

Specs

key_name() :: atom()

Specs

refresh_fun() :: (WeChat.client() -> refresh_fun_result())

Specs

refresh_fun_result() ::
  {:ok, token(), expires_in()}
  | {:ok, token_list(), expires_in()}
  | {:error, any()}

Specs

refresh_option() ::
  {WeChat.Storage.Adapter.store_id(), key_name(), refresh_fun()}

Specs

refresh_options() :: [refresh_option()]

Specs

token() :: String.t()

Specs

token_list() :: [{key_name(), token(), expires_in()}]

Link to this section Functions

Link to this function

component_refresh_options(client)

View Source

Specs

component_refresh_options(WeChat.client()) :: refresh_options()

输出[第三方平台]的 refresh_options

刷新如下token

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

get_refresh_options_by_client(client)

View Source

Specs

get_refresh_options_by_client(WeChat.client()) :: refresh_options()

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

rules:

  • by_component? == true: component_refresh_options/1
  • official_account: official_account_refresh_options/0
  • mini_program: mini_program_refresh_options/0
Link to this function

mini_program_refresh_options(client)

View Source

Specs

mini_program_refresh_options(WeChat.Work.client()) :: refresh_options()

输出[小程序]的 refresh_options

刷新如下token

  • access_token
Link to this function

official_account_refresh_options(client)

View Source

Specs

official_account_refresh_options(WeChat.client()) :: refresh_options()

输出[公众号]的 refresh_options

刷新如下token

  • access_token
  • js_api_ticket
  • wx_card_ticket
Link to this function

refresh_access_token(client)

View Source

Specs

refresh_access_token(WeChat.client()) :: refresh_fun_result()
Link to this function

refresh_authorizer_access_token(client)

View Source

Specs

refresh_authorizer_access_token(WeChat.client()) :: refresh_fun_result()
Link to this function

refresh_component_access_token(client)

View Source

Specs

refresh_component_access_token(WeChat.client()) :: refresh_fun_result()
Link to this function

refresh_mini_program_access_token(client)

View Source

Specs

refresh_mini_program_access_token(WeChat.client()) :: refresh_fun_result()
Link to this function

refresh_ticket(ticket_type, client)

View Source

Specs

Link to this function

refresh_work_access_token(client, cache_id, agent_id)

View Source

Specs

Link to this function

work_refresh_options(client)

View Source

Specs

work_refresh_options(WeChat.client()) :: refresh_options()

输出[企业微信]的 refresh_options

刷新如下token

  • access_token