From d1a3d31d3f283da8a149d380ffe57d869e25cdbb Mon Sep 17 00:00:00 2001 From: feng626 <1304903146@qq.com> Date: Thu, 21 Oct 2021 19:12:02 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=A2=E6=88=B7=E7=AB=AF=E5=8D=8F?= =?UTF-8?q?=E8=AE=AE=E5=86=85=E5=AE=B9=E6=B7=BB=E5=8A=A0rdp=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/authentication/api/connection_token.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/authentication/api/connection_token.py b/apps/authentication/api/connection_token.py index e496afbf2..842011a94 100644 --- a/apps/authentication/api/connection_token.py +++ b/apps/authentication/api/connection_token.py @@ -150,15 +150,19 @@ class ClientProtocolMixin: def get_client_protocol_data(self, serializer): asset, application, system_user, user = self.get_request_resource(serializer) protocol = system_user.protocol + username = user.username + name = '' if protocol == 'rdp': name, config = self.get_rdp_file_content(serializer) elif protocol == 'vnc': raise HttpResponse(status=404, data={"error": "VNC not support"}) else: config = 'ssh://system_user@asset@user@jumpserver-ssh' + filename = "{}-{}-jumpserver".format(username, name) data = { + "filename": filename, "protocol": system_user.protocol, - "username": user.username, + "username": username, "config": config } return data