From 4b28b079dc393aa21d6103870022814aedf215e8 Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 14 Jan 2025 11:14:19 +0800 Subject: [PATCH] perf: fix rdp file resolution value --- apps/authentication/api/connection_token.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/apps/authentication/api/connection_token.py b/apps/authentication/api/connection_token.py index f72a51bdb..1d5c22514 100644 --- a/apps/authentication/api/connection_token.py +++ b/apps/authentication/api/connection_token.py @@ -123,13 +123,15 @@ class RDPFileClientProtocolURLMixin: # rdp_options['domain:s'] = token.account_ad_domain # 设置宽高 - height = self.request.query_params.get('height') - width = self.request.query_params.get('width') - if width and height: - rdp_options['desktopwidth:i'] = width - rdp_options['desktopheight:i'] = height - rdp_options['winposstr:s'] = f'0,1,0,0,{width},{height}' - rdp_options['dynamic resolution:i'] = '0' + + resolution_value = token.connect_options.get('resolution', 'auto') + if resolution_value != 'auto': + width, height = resolution_value.split('x') + if width and height: + rdp_options['desktopwidth:i'] = width + rdp_options['desktopheight:i'] = height + rdp_options['winposstr:s'] = f'0,1,0,0,{width},{height}' + rdp_options['dynamic resolution:i'] = '0' color_quality = self.request.query_params.get('rdp_color_quality') color_quality = color_quality if color_quality else os.getenv('JUMPSERVER_COLOR_DEPTH', RDPColorQuality.HIGH)