|
|
|
@ -23,13 +23,13 @@ class CheckToken |
|
|
|
try { |
|
|
|
$token = Request::header()['token']??false; |
|
|
|
if(!$token) |
|
|
|
throw new Exception('Without Token',201); |
|
|
|
throw new Exception('Without Token',403); |
|
|
|
$userinfo = checkToken($token); |
|
|
|
if($userinfo['code'] != 200) |
|
|
|
throw new Exception('Token checked error',202); |
|
|
|
throw new Exception('Token checked error',403); |
|
|
|
$request->userInfo = $userinfo['data']; |
|
|
|
if (!Session::get('login_user_data')) { |
|
|
|
throw new Exception('用户未登录,请先登陆后操作',203); |
|
|
|
throw new Exception('用户未登录,请先登陆后操作',201); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (\Exception $err){ |
|
|
|
|