|
|
|
@ -21,10 +21,10 @@ class CheckAdmin |
|
|
|
try { |
|
|
|
$token = Request::header()['token']??false; |
|
|
|
if(!$token) |
|
|
|
throw new Exception('Without Token',403); |
|
|
|
throw new Exception('当前登录已失效,请重新登录',403); |
|
|
|
$userinfo = checkToken($token); |
|
|
|
if($userinfo['code'] != 200) |
|
|
|
throw new Exception('Token checked error',403); |
|
|
|
throw new Exception('当前登录已失效,请重新登录',403); |
|
|
|
$request->userInfo = $userinfo['data']; |
|
|
|
if (!Cache::store('redis')->get('login_admin_user_data')) { |
|
|
|
throw new Exception('管理员未登陆,请先登陆后操作',201); |
|
|
|
|