diff --git a/apps/authentication/api/connection_token.py b/apps/authentication/api/connection_token.py index ae9e4a2de..d4d58e397 100644 --- a/apps/authentication/api/connection_token.py +++ b/apps/authentication/api/connection_token.py @@ -140,13 +140,13 @@ class UserConnectionTokenViewSet(RootOrgViewMixin, SerializerMixin2, GenericView # Todo: 上线后地址是 JumpServerAddr:3389 address = self.request.query_params.get('address') or '1.1.1.1' options['full address:s'] = address - options['username:s'] = '{}@{}'.format(user.username, token) + options['username:s'] = '{}|{}'.format(user.username, token) options['desktopwidth:i'] = width options['desktopheight:i'] = height data = '' for k, v in options.items(): data += f'{k}:{v}\n' - response = HttpResponse(data, content_type='text/plain') + response = HttpResponse(data, content_type='application/octet-stream') filename = "{}-{}-jumpserver.rdp".format(user.username, asset.hostname) response['Content-Disposition'] = 'attachment; filename={}'.format(filename) return response