注册接口

This commit is contained in:
2025-05-05 20:23:01 +08:00
parent 91a1d06b53
commit c61357eca1
4 changed files with 153 additions and 130 deletions

View File

@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
use App\BaseApp\BaseController;
use App\Service\LoginService;
use Illuminate\Http\JsonResponse;
class LoginController extends BaseController
{
@@ -18,7 +19,7 @@ class LoginController extends BaseController
/**
* 登录
* @Method POST
* @return \Illuminate\Http\JsonResponse
* @return JsonResponse
* @throws \Exception
*/
public function login()
@@ -34,4 +35,23 @@ class LoginController extends BaseController
);
}
/**
* 注册
* @Method POST
* @return JsonResponse
* @throws \Exception
*/
public function register()
{
$this->insertField = [
'account', 'password', 'email', 'code'
];
$param = $this->checkRequiredFields(request()->post());
return jok(
$this->service->register($param['account'], $param['password'], $param['email'], $param['code']),
'登录成功'
);
}
}