userInfo = $userinfo['data']; if (!Cache::store('redis')->get('login_user_data')) { throw new Exception('用户未登陆,请先登陆后操作',201); } } catch (\Exception $err){ return json(['code'=>$err->getCode(),'msg'=>$err->getMessage()]); } return $next($request); } }