login新增Service

This commit is contained in:
JaguarJack 2020-06-24 08:47:46 +08:00
parent 23fa6ab097
commit 8b4404df55
9 changed files with 55 additions and 6 deletions

View File

@ -0,0 +1,23 @@
<?php
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
namespace catchAdmin\login;
use catcher\ModuleService;
use think\Service;
class LoginService extends ModuleService
{
public function loadRouteFrom()
{
// TODO: Implement loadRouteFrom() method.
return __DIR__ . DIRECTORY_SEPARATOR . 'route.php';
}
}

View File

@ -4,8 +4,11 @@
"description": "", "description": "",
"keywords": [], "keywords": [],
"order": 1, "order": 1,
"services": [], "services": [
"\\catchAdmin\\login\\LoginService"
],
"aliases": {}, "aliases": {},
"files": [], "files": [],
"requires": [] "requires": [],
"enable": true
} }

View File

@ -1,6 +1,9 @@
<?php <?php
# 登入 $router->group(function () use ($router){
$router->post('login', '\catchAdmin\login\controller\Index@login'); # 登入
$router->post('logout', '\catchAdmin\login\controller\Index@logout'); $router->post('login', '\catchAdmin\login\controller\Index@login');
$router->post('refresh/token', '\catchAdmin\login\controller\Index@refreshToken'); $router->post('logout', '\catchAdmin\login\controller\Index@logout');
$router->post('refresh/token', '\catchAdmin\login\controller\Index@refreshToken');
})->middleware('auth');

View File

@ -0,0 +1,10 @@
<?php
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------

View File

@ -0,0 +1,10 @@
<?php
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------