refresh token
This commit is contained in:
parent
b4bb0a1910
commit
5057f3eb9e
@ -7,6 +7,7 @@ use catcher\base\CatchController;
|
|||||||
use catcher\CatchAuth;
|
use catcher\CatchAuth;
|
||||||
use catcher\CatchResponse;
|
use catcher\CatchResponse;
|
||||||
use catcher\exceptions\LoginFailedException;
|
use catcher\exceptions\LoginFailedException;
|
||||||
|
use thans\jwt\facade\JWTAuth;
|
||||||
|
|
||||||
class Index extends CatchController
|
class Index extends CatchController
|
||||||
{
|
{
|
||||||
@ -55,4 +56,19 @@ class Index extends CatchController
|
|||||||
{
|
{
|
||||||
return CatchResponse::success();
|
return CatchResponse::success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* refresh token
|
||||||
|
*
|
||||||
|
* @author JaguarJack
|
||||||
|
* @email njphper@gmail.com
|
||||||
|
* @time 2020/5/18
|
||||||
|
* @return \think\response\Json
|
||||||
|
*/
|
||||||
|
public function refreshToken()
|
||||||
|
{
|
||||||
|
return CatchResponse::success([
|
||||||
|
'token' => JWTAuth::refresh()
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,4 +2,5 @@
|
|||||||
# 登入
|
# 登入
|
||||||
$router->post('login', '\catchAdmin\login\controller\Index@login');
|
$router->post('login', '\catchAdmin\login\controller\Index@login');
|
||||||
$router->post('logout', '\catchAdmin\login\controller\Index@logout');
|
$router->post('logout', '\catchAdmin\login\controller\Index@logout');
|
||||||
|
$router->post('refresh/token', '\catchAdmin\login\controller\Index@refreshToken');
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user