param(); $token = $auth->attempt($params); return CatchResponse::success([ 'token' => $token, ], '登录成功'); } catch (\Exception $exception) { return CatchResponse::fail('登录失败', $exception->getCode()); } } /** * 登出 * * @time 2019年11月28日 * @return \think\response\Json */ public function logout(): \think\response\Json { 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() ]); } }