refresh token

This commit is contained in:
yanwenwu 2020-05-18 13:41:46 +08:00
parent b4bb0a1910
commit 5057f3eb9e
2 changed files with 17 additions and 0 deletions

View File

@ -7,6 +7,7 @@ use catcher\base\CatchController;
use catcher\CatchAuth;
use catcher\CatchResponse;
use catcher\exceptions\LoginFailedException;
use thans\jwt\facade\JWTAuth;
class Index extends CatchController
{
@ -55,4 +56,19 @@ class Index extends CatchController
{
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()
]);
}
}

View File

@ -2,4 +2,5 @@
# 登入
$router->post('login', '\catchAdmin\login\controller\Index@login');
$router->post('logout', '\catchAdmin\login\controller\Index@logout');
$router->post('refresh/token', '\catchAdmin\login\controller\Index@refreshToken');