38 lines
742 B
PHP
38 lines
742 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Http\Controllers;
|
||
|
|
|
||
|
|
use App\BaseApp\BaseController;
|
||
|
|
use App\Service\LoginService;
|
||
|
|
|
||
|
|
class LoginController extends BaseController
|
||
|
|
{
|
||
|
|
//
|
||
|
|
|
||
|
|
public function __construct()
|
||
|
|
{
|
||
|
|
parent::__construct();
|
||
|
|
$this->service = LoginService::getInstance();
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 登录
|
||
|
|
* @Method POST
|
||
|
|
* @return \Illuminate\Http\JsonResponse
|
||
|
|
* @throws \Exception
|
||
|
|
*/
|
||
|
|
public function login()
|
||
|
|
{
|
||
|
|
$this->insertField = [
|
||
|
|
'account', 'password', 'is_remember'
|
||
|
|
];
|
||
|
|
$param = $this->checkRequiredFields(request()->post());
|
||
|
|
|
||
|
|
return jok(
|
||
|
|
$this->service->login($param['account'], $param['password']),
|
||
|
|
'登录成功'
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|