public function rpcMiddles(Request $request): array
    {
        $beanName = 'serviceDispatcher';
        if (!\Swoft::hasBean($beanName)) {
            return [];
        }

        /** @var \Swoft\Rpc\Server\ServiceDispatcher $dispatcher */
        $dispatcher = \bean($beanName);
        $middleType = (int)$request->query('type');

        // 1 only return user's
        if ($middleType === 1) {
            return $dispatcher->getMiddlewares();
        }

        return $dispatcher->requestMiddleware();
    }