fix: The application cannot be embedded (#1931)

This commit is contained in:
shaohuzhang1 2024-12-27 11:55:03 +08:00 committed by GitHub
parent c6f821ce53
commit 17616205b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -279,7 +279,8 @@ class ApplicationSerializer(serializers.Serializer):
'x_type': float_location.get('x', {}).get('type', 'right'),
'x_value': float_location.get('x', {}).get('value', 0),
'y_type': float_location.get('y', {}).get('type', 'bottom'),
'y_value': float_location.get('y', {}).get('value', 30)}))
'y_value': float_location.get('y', {}).get('value', 30),
'max_kb_id': str(uuid.uuid1()).replace('-', '')}))
response = HttpResponse(s, status=200, headers={'Content-Type': 'text/javascript'})
return response

View File

@ -132,7 +132,7 @@ const initChat=(root)=>{
function initMaxkb(){
const maxkb=document.createElement('div')
const root=document.createElement('div')
const maxkbId = 'maxkb-'+crypto.randomUUID().split('-')[0]
const maxkbId = 'maxkb-'+'{{max_kb_id}}'
root.id=maxkbId
initMaxkbStyle(maxkb, maxkbId)
maxkb.appendChild(root)