From 411102ed85a2275b7ba86e8151718ab6fcb82491 Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 30 Jun 2023 18:40:43 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=AE=8C=E5=96=84=20protocol=20?= =?UTF-8?q?=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/authentication/api/connection_token.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/authentication/api/connection_token.py b/apps/authentication/api/connection_token.py index ea00cfec6..c779540a1 100644 --- a/apps/authentication/api/connection_token.py +++ b/apps/authentication/api/connection_token.py @@ -75,9 +75,10 @@ class RDPFileClientProtocolURLMixin: rdp_options['screen mode id:i'] = '2' if full_screen else '1' # 设置 RDP Server 地址 - endpoint = self.get_smart_endpoint(protocol=token.protocol, asset=token.asset) + protocol = 'rdp7' if token.protocol == 'rdp7' else 'rdp' + endpoint = self.get_smart_endpoint(protocol=protocol, asset=token.asset) # 由于 remoteapp 使用 mstsc 客户端连接的时候,都是 rdp 端口, 这里特殊判断 rdp7 端口 - protocol_port = endpoint.rdp7_port if token.protocol == 'rdp7' else endpoint.rdp_port + protocol_port = endpoint.get_protocol_port(protocol, default=3389) rdp_options['full address:s'] = f'{endpoint.host}:{protocol_port}' # 设置用户名