perf: 优化 xrdp setting

This commit is contained in:
ibuler
2021-06-08 15:23:40 +08:00
committed by 老广
parent a2eb431015
commit 33a29ae788
4 changed files with 10 additions and 9 deletions

View File

@@ -141,8 +141,8 @@ class UserConnectionTokenViewSet(RootOrgViewMixin, SerializerMixin2, GenericView
token = self.create_token(user, asset, application, system_user)
# Todo: 上线后地址是 JumpServerAddr:3389
address = settings.RDP_ADDR
if address == 'localhost:3389':
address = settings.TERMINAL_RDP_ADDR
if not address or address == 'localhost:3389':
address = request.get_host().split(':')[0] + ':3389'
options['full address:s'] = address
options['username:s'] = '{}|{}'.format(user.username, token)