test_lgq/niucloud/app/api/controller/login/Register.php
2024-01-24 17:36:08 +08:00

60 lines
1.7 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的saas管理平台
// +----------------------------------------------------------------------
// | 官方网址https://www.niucloud-admin.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
namespace app\api\controller\login;
use app\service\api\login\RegisterService;
use core\base\BaseController;
use think\Response;
class Register extends BaseController
{
/**
* 账号密码注册
* @return Response
*/
public function account()
{
$data = $this->request->params([
['username', ''],
['password', ''],
['mobile', ''],
]);
//参数验证
$this->validate($data, 'app\validate\member\Member.account_register');
//验证码验证
$result = (new RegisterService())->account($data['username'], $data['password'], $data['mobile']);
return success($result);
}
/**
* 手机号注册
* @return Response
*/
public function mobile()
{
$data = $this->request->params([
['mobile', ''],
]);
//参数验证
$this->validate($data, [
'mobile' => 'require|mobile'
]);
//验证码验证
$result = (new RegisterService())->mobile($data['mobile']);
return success($result);
}
}