智简魔方文档

发送手机验证码

方法概览

项目内容
文档类型PHP 类方法
方法标识app\common\logic\VerificationCodeLogic::sendPhoneCode
所属业务认证安全
来源模块/系统验证码逻辑类

功能说明

发送手机验证码

调用示例

$param = ['action' => 'string', 'phone_code' => 86, 'phone' => '13800138000', 'token' => 'example-token', 'captcha' => 'string'];
$result = (new \app\common\logic\VerificationCodeLogic())->sendPhoneCode($param);

参数

参数类型必填默认值校验规则说明
param.actionstring验证动作login登录register注册verify验证手机update修改手机password_reset重置密码
param.phone_codeint国际电话区号 未登录或修改手机时需要
param.phonestring手机号 未登录或修改手机时需要
param.tokenstring图形验证码唯一识别码
param.captchastring图形验证码

返回值

返回项类型说明
statusint状态码,200成功,400失败
msgstring提示信息

正常返回

{
  "status": 1,
  "msg": "string"
}

异常情况

异常类型说明
Throwable调用失败时由具体实现抛出异常,异常信息以运行时结果为准。