fix: 修改tokent中信息中没有返回 Protocols 的问题

fix: 优化protocols

fix: session bpp

token 时间加长
pull/6086/head
ibuler 2021-04-29 14:18:52 +08:00 committed by 老广
parent 72f9d0d371
commit 8ca2522c71
2 changed files with 6 additions and 3 deletions

View File

@ -79,7 +79,7 @@ class UserConnectionTokenViewSet(RootOrgViewMixin, SerializerMixin2, GenericView
}) })
key = self.CACHE_KEY_PREFIX.format(token) key = self.CACHE_KEY_PREFIX.format(token)
cache.set(key, value, timeout=20) cache.set(key, value, timeout=30*60)
return token return token
def create(self, request, *args, **kwargs): def create(self, request, *args, **kwargs):
@ -102,7 +102,7 @@ class UserConnectionTokenViewSet(RootOrgViewMixin, SerializerMixin2, GenericView
'desktopwidth:i': '1280', 'desktopwidth:i': '1280',
'desktopheight:i': '800', 'desktopheight:i': '800',
'use multimon:i': '1', 'use multimon:i': '1',
'session bpp:i': '24', 'session bpp:i': '32',
'audiomode:i': '0', 'audiomode:i': '0',
'disable wallpaper:i': '0', 'disable wallpaper:i': '0',
'disable full window drag:i': '0', 'disable full window drag:i': '0',

View File

@ -8,6 +8,7 @@ from users.models import User
from assets.models import Asset, SystemUser, Gateway from assets.models import Asset, SystemUser, Gateway
from applications.models import Application from applications.models import Application
from users.serializers import UserProfileSerializer from users.serializers import UserProfileSerializer
from assets.serializers import ProtocolsField
from perms.serializers.asset.permission import ActionsField from perms.serializers.asset.permission import ActionsField
from .models import AccessKey, LoginConfirmSetting, SSOToken from .models import AccessKey, LoginConfirmSetting, SSOToken
@ -150,9 +151,11 @@ class ConnectionTokenUserSerializer(serializers.ModelSerializer):
class ConnectionTokenAssetSerializer(serializers.ModelSerializer): class ConnectionTokenAssetSerializer(serializers.ModelSerializer):
protocols = ProtocolsField(label='Protocols', read_only=True)
class Meta: class Meta:
model = Asset model = Asset
fields = ['id', 'hostname', 'ip', 'port', 'org_id'] fields = ['id', 'hostname', 'ip', 'protocols', 'org_id']
class ConnectionTokenSystemUserSerializer(serializers.ModelSerializer): class ConnectionTokenSystemUserSerializer(serializers.ModelSerializer):