View Source WeChat.MiniProgram.Auth (wechat v0.16.0)

小程序 - 权限接口

Summary

Types

会话密钥

Types

@type session_key() :: String.t()

会话密钥

Functions

Link to this function

check_session(client, openid, session_key)

View Source
@spec check_session(WeChat.client(), WeChat.openid(), session_key()) ::
  WeChat.response()

检验登录态 - 官方文档

校验服务器所保存的登录态 session_key 是否合法。为了保持 session_key 私密性,接口不明文传输 session_key,而是通过校验登录态签名完成。

Link to this function

code2session(client, code)

View Source
@spec code2session(WeChat.client(), code :: String.t()) :: WeChat.response()

小程序登录

登录流程

官方文档:

Link to this function

decode_get_user_sensitive_info(session_key, encrypted_data, iv)

View Source
This function is deprecated. Use WeChat.MiniProgram.UserInfo.decode_get_user_sensitive_info/3 instead.

服务端获取开放数据 - 包含敏感数据 - 官方文档

Link to this function

decode_user_info(session_key, raw_data, signature)

View Source
This function is deprecated. Use WeChat.MiniProgram.UserInfo.decode_user_info/3 instead.

服务端获取开放数据 - 官方文档

登录流程

Link to this function

get_access_token(client)

View Source
@spec get_access_token(WeChat.client()) :: WeChat.response()

获取AccessToken - 官方文档

Link to this function

get_paid_unionid(client, openid)

View Source
This function is deprecated. Use WeChat.MiniProgram.UserInfo.get_paid_unionid/2 instead.

See WeChat.MiniProgram.UserInfo.get_paid_unionid/2.

Link to this function

get_paid_unionid(client, openid, transaction_id)

View Source
This function is deprecated. Use WeChat.MiniProgram.UserInfo.get_paid_unionid/3 instead.

See WeChat.MiniProgram.UserInfo.get_paid_unionid/3.

Link to this function

get_paid_unionid(client, openid, mch_id, out_trade_no)

View Source
This function is deprecated. Use WeChat.MiniProgram.UserInfo.get_paid_unionid/4 instead.

See WeChat.MiniProgram.UserInfo.get_paid_unionid/4.

Link to this function

reset_session(client, openid, session_key)

View Source
@spec reset_session(WeChat.client(), WeChat.openid(), session_key()) ::
  WeChat.response()

重置登录态 - 官方文档

重置指定的登录态 session_key。为了保持 session_key 私密性,接口不明文传入 session_key,而是通过校验登录态签名完成。