智简魔方文档

注册

方法概览

项目内容
文档类型PHP 类方法
方法标识app\common\model\ClientModel::register
所属业务认证安全
来源模块/系统用户模型

功能说明

注册

调用示例

$type = 'phone';
$account = '18423467948';
$phone_code = '86';
$username = 'wyh';
$code = '1234';
$password = '123456';
$re_password = '1';
$customfield = [];
$result = (new \app\common\model\ClientModel())->register($type, $account, $phone_code, $username, $code, $password, $re_password, $customfield);

参数

参数类型必填默认值校验规则说明
typestringphonerequired登录类型:phone手机注册,email邮箱注册
accountstring18423467948required手机号或邮箱
phone_codestring86国家区号(登录类型为手机注册时需要传此参数)
usernamestringwyh姓名
codestring1234required验证码
passwordstring123456required密码
re_passwordstring1required重复密码
customfieldobject{}自定义字段,格式:{"field1":'test',"field2":'test2'}

返回值

返回项类型说明
data.jwtstringjwt:注册后放在请求头Authorization里,拼接成如下格式:Bearer+空格+yJ0eX.test.ste

正常返回

{
  "data": {
    "jwt": "string"
  }
}

异常情况

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