\eapie\source\plugin\weixin\sessionapplet

Summary

Methods
Properties
Constants
get_access_token()
get_qrcode()
get_qrcode_length()
get_openid()
get_userinfo()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
_error()
_success()
No private properties found
N/A

Methods

get_access_token()

get_access_token(array  $config = array()) : string

获取接口调用凭证

Parameters

array $config

配置参数 { id [str] [必填] [小程序唯一凭证] secret [str] [必填] [小程序唯一凭证密钥] }

Returns

string —

接口调用凭证

get_qrcode()

get_qrcode(  $token, array  $config = array()) : \eapie\source\plugin\weixin\session\binary

获取小程序码

Parameters

$token
array $config

配置参数 { token [str] [必填] [微信小程序接口调用凭证] scene [str] [必填] [最大32个可见字符,只支持数字,大小写英文以及部分特殊字符] page [str] [可选] [默认主页,必须是已经发布的小程序存在的页面] width [int] [可选] [默认430,二维码的宽度,单位 px,最小 280px,最大 1280px] auto_color [bol] [可选] [默认false,自动配置线条颜色] line_color [arr] [可选] [auto_color 为 false 时生效,使用 rgb 设置颜色 例如 {"r":"xxx","g":"xxx","b":"xxx"} 十进制表示] is_hyaline [bol] [可选] [默认false,是否需要透明底色] }

Returns

\eapie\source\plugin\weixin\session\binary —

图片二进制内容

get_qrcode_length()

get_qrcode_length(  $token, array  $config = array()) : \eapie\source\plugin\weixin\session\binary

获取小程序码

Parameters

$token
array $config

配置参数 { token [str] [必填] [微信小程序接口调用凭证] path [str] [可选] [默认主页,必须是已经发布的小程序存在的页面] width [int] [可选] [默认430,二维码的宽度,单位 px,最小 280px,最大 1280px] auto_color [bol] [可选] [默认false,自动配置线条颜色] line_color [arr] [可选] [auto_color 为 false 时生效,使用 rgb 设置颜色 例如 {"r":"xxx","g":"xxx","b":"xxx"} 十进制表示] is_hyaline [bol] [可选] [默认false,是否需要透明底色] }

Returns

\eapie\source\plugin\weixin\session\binary —

图片二进制内容

get_openid()

get_openid(\eapie\source\plugin\weixin\session\WxPayConfig  $config) : string

获取openid

Parameters

\eapie\source\plugin\weixin\session\WxPayConfig $config

配置对象

Returns

string

get_userinfo()

get_userinfo(array  $config) : array

获取微信用户数据

Parameters

array $config

配置参数 { id [str] [必填] [小程序唯一凭证] secret [str] [必填] [小程序唯一凭证密钥] code [str] [必填] [登录凭证,wx.login] iv [str] [必填] [加密算法的初始向量,wx.getUserInfo] encryptedData [str] [必填] [加密数据,wx.getUserInfo] }

Returns

array

_error()

_error(integer  $errno = 1) : array

错误提示

Parameters

integer $errno

错误码

Returns

array

_success()

_success(  $data = NULL) 

成功时,返回的数据

Parameters

$data