初始化提交
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Request\LoginRequest;
|
||||
use App\Services\LoginService;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
/**
|
||||
* 登陆
|
||||
*/
|
||||
class LoginController extends AbstractController
|
||||
{
|
||||
/**
|
||||
* 微信手机号登陆
|
||||
* @return ResponseInterface
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function wechatMobileLogin(): ResponseInterface
|
||||
{
|
||||
// 验证参数
|
||||
$request = $this->container->get(LoginRequest::class);
|
||||
$request->scene('wechatMobileLogin')->validateResolved();
|
||||
|
||||
$LoginService = new LoginService();
|
||||
$data = $LoginService->wechatMobileLogin();
|
||||
return $this->response->json($data);
|
||||
}
|
||||
|
||||
// 手机号登陆
|
||||
public function mobileLogin(): ResponseInterface
|
||||
{
|
||||
// 验证参数
|
||||
$request = $this->container->get(LoginRequest::class);
|
||||
$request->scene('mobileLogin')->validateResolved();
|
||||
|
||||
$LoginService = new LoginService();
|
||||
$data = $LoginService->mobileLogin();
|
||||
return $this->response->json($data);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user