发送邮件验证码
方法概览
| 项目 | 内容 |
|---|---|
| 文档类型 | PHP 类方法 |
| 方法标识 | app\common\logic\VerificationCodeLogic::sendEmailCode |
| 所属业务 | 消息通知 |
| 来源模块/系统 | 验证码逻辑类 |
功能说明
发送邮件验证码
调用示例
$param = ['action' => 'string', 'email' => 'user@example.com', 'token' => 'example-token', 'captcha' => 'string'];
$result = (new \app\common\logic\VerificationCodeLogic())->sendEmailCode($param);参数
| 参数 | 类型 | 必填 | 默认值 | 校验规则 | 说明 |
|---|---|---|---|---|---|
param.action | string | 否 | — | — | 验证动作login登录register注册verify验证邮箱update修改邮箱password_reset重置密码 |
param.email | string | 否 | — | — | 邮箱 未登录或修改邮箱时需要 |
param.token | string | 否 | — | — | 图形验证码唯一识别码 |
param.captcha | string | 否 | — | — | 图形验证码 |
返回值
| 返回项 | 类型 | 说明 |
|---|---|---|
status | int | 状态码,200成功,400失败 |
msg | string | 提示信息 |
正常返回
{
"status": 1,
"msg": "string"
}异常情况
| 异常类型 | 说明 |
|---|---|
Throwable | 调用失败时由具体实现抛出异常,异常信息以运行时结果为准。 |