input('auth_data') ?? $request->header('authorization'); if (!$authorization) throw new ApiException(403, '未登录或登陆已过期'); $user = AuthService::decryptAuthData($authorization); if (!$user) throw new ApiException(403, '未登录或登陆已过期'); $request->merge([ 'user' => $user ]); return $next($request); } }