fix(task): 修复推送过期的问题

fix(rdp): 修复下载rdp文件失败的问题
pull/6000/head
ibuler 4 years ago committed by Jiangjie.Bai
parent 3d6aa15ece
commit 7b679f3e82

@ -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

Loading…
Cancel
Save