header('client', ''); if(empty($clientName)) { return \json('设备未授权'); } /* * 客户端信息 */ $client = new HttpClient( $clientName, $request->header('client-id', ''), $request->header('client-version', ''), ); /* * 获取客户端 */ \app\Request::macro('getClient', function () use ($client) { return $client; }); // Next. return $next($request); } }