初始化项目

This commit is contained in:
2025-05-12 00:19:35 +08:00
parent f6e4638ee6
commit fc327e9f48
27 changed files with 11107 additions and 29 deletions

View File

@@ -0,0 +1,57 @@
<?php
namespace App\Http\Controllers\Api;
use App\BaseApp\BaseController;
use App\Service\LoginService;
use Illuminate\Http\JsonResponse;
class LoginController extends BaseController
{
//
public function __construct()
{
parent::__construct();
$this->service = LoginService::getInstance();
}
/**
* 登录
* @Method POST
* @return JsonResponse
* @throws \Exception
*/
public function login()
{
$this->insertField = [
'account', 'password', 'remember'
];
$param = $this->checkRequiredFields(request()->post());
return jok(
$this->service->login($param['account'], $param['password']),
'登录成功'
);
}
/**
* 注册
* @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']),
'登录成功'
);
}
}