Basic Command Word
verifySign
php
\FresnsCmdWord::plugin('Fresns')->verifySign($wordBody)
Parameter Name | Type | Required | Description |
---|---|---|---|
platformId | Number | required | 平台编号(配置表 platforms 键名的键值) |
version | String | required | 语义化版本号 |
appId | String | required | App ID |
timestamp | Number | required | 签名生成时间(当前 Unix 时间戳,精确到秒或毫秒都支持) |
sign | String | required | 请求签名 |
aid | String | optional | 账号参数(账号主表 accounts > aid 字段) |
aidToken | String | optional | 账号身份凭证 |
uid | Number | optional | 用户参数(用户主表 users > uid 字段) |
uidToken | String | optional | 用户身份凭证 |
verifyType | Number | optional | 验证 session_keys->type,留空则默认为 1 |
verifyUnikey | String | optional | 类型为 3 时专用,验证关联插件 |
verifyUrlAuthorization
php
\FresnsCmdWord::plugin('Fresns')->verifyUrlAuthorization($wordBody)
Parameter Name | Type | Required | Description |
---|---|---|---|
urlAuthorization | String | required | 参见:为插件生成路径凭证 |
Return Example
json
{
"code": 0,
"message": "ok",
"data": {
"appId": "qe12345",
"platformId": 4,
"version": "2.0.0",
"deviceInfo": "",
"langTag": "zh-Hans",
"timezone": "+8",
"contentFormat": "",
"aid": "6a3bb3bc",
"aidToken": "uoX1hk6SHUgB2MFGJwNx38dem9DA7Vsz",
"uid": 782622,
"uidToken": "PqBpwPLJgfd1sH0X5JffYFGxTSc8RW7c",
"signature": "d5db4371a0c2d7e17009dea8d53ecf15a7ec07b9",
"timestamp": 1626426833
}
}
uploadSessionLog
php
\FresnsCmdWord::plugin('Fresns')->uploadSessionLog($wordBody)
Parameter Name | Type | Required | Description |
---|---|---|---|
type | Number | required | 记录类型 |
platformId | Number | required | 平台编号(配置表 platforms 键名的键值) |
version | String | required | 语义化版本号,例如: 2.0.0 |
appId | String | optional | 密钥 App ID |
langTag | String | optional | Language Tag |
pluginUnikey | String | optional | 插件 Unikey |
aid | String | optional | 账号 |
uid | Number | optional | 用户 |
objectName | String | required | 功能模型名或者接口路径 例如模型名 App\Models\Post 例如接口路径:/api/v2/account/login |
objectAction | String | required | 行为描述,自定义输入内容 |
objectResult | Number | required | 1.未知或执行中 / 2.成功 / 3.失败 |
objectOrderId | String | optional | 例如发表行为,则代表发表内容的 ID 插件行为,凭此 ID 可查询对应插件那边记录的关联信息 |
deviceInfo | Object | optional | 交互设备信息 |
deviceToken | String | optional | 交互设备 Token 例如 iOS Device Token 或 Android Device Token 可应用于推送消息 |
moreJson | Object | optional | 其他自定义信息 |
sendCode
php
\FresnsCmdWord::plugin('Fresns')->sendCode($wordBody)
Parameter Name | Type | Required | Description |
---|---|---|---|
type | Number | required | 类型:1.邮件验证码 / 2.短信验证码 |
account | String | required | 账号(邮箱或手机号) |
countryCode | Number | optional | 国际区号(手机号专用) |
templateId | Number | required | 验证码模板 ID |
langTag | String | required | Language Tag |
checkCode
php
\FresnsCmdWord::plugin('Fresns')->checkCode($wordBody)
Parameter Name | Type | Required | Description |
---|---|---|---|
type | Number | required | 类型:1.邮件验证码 / 2.短信验证码 |
account | String | required | 账号(邮箱或手机号) |
countryCode | Number | optional | 国际区号(手机号专用) |
verifyCode | String | required | 验证码 |
templateId | Number | required | 验证码模板 ID |
ipInfo
php
\FresnsCmdWord::plugin('Fresns')->ipInfo($wordBody)
Parameter Name | Type | Required | Description |
---|---|---|---|
ipv4 | String | optional | |
ipv6 | String | optional |
- 二选一传参
- 输出结果同 session_logs->device_info