feat: 后端支持嵌入第三方
This commit is contained in:
parent
1e2ed4af88
commit
5488804ea8
@ -47,7 +47,7 @@ MIDDLEWARE = [
|
|||||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||||
'django.middleware.common.CommonMiddleware',
|
'django.middleware.common.CommonMiddleware',
|
||||||
'django.contrib.messages.middleware.MessageMiddleware',
|
'django.contrib.messages.middleware.MessageMiddleware',
|
||||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
|
||||||
]
|
]
|
||||||
|
|
||||||
JWT_AUTH = {
|
JWT_AUTH = {
|
||||||
|
|||||||
@ -77,7 +77,9 @@ def page_not_found(request, exception):
|
|||||||
file = open(index_path, "r", encoding='utf-8')
|
file = open(index_path, "r", encoding='utf-8')
|
||||||
content = file.read()
|
content = file.read()
|
||||||
file.close()
|
file.close()
|
||||||
return HttpResponse(content, status=200)
|
if request.path.startswith('/ui/chat/'):
|
||||||
|
return HttpResponse(content, status=200)
|
||||||
|
return HttpResponse(content, status=200, headers={'X-Frame-Options': 'DENY'})
|
||||||
|
|
||||||
|
|
||||||
handler404 = page_not_found
|
handler404 = page_not_found
|
||||||
|
|||||||
@ -200,7 +200,7 @@ const getChatOpen: (applicaiton_id: String) => Promise<Result<any>> = (applicait
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
const postChatMessage: (chat_id: string, message: string) => Promise<any> = (chat_id, message) => {
|
const postChatMessage: (chat_id: string, message: string) => Promise<any> = (chat_id, message) => {
|
||||||
return postStream(`/api/${prefix}/chat_message/${chat_id}`, { message })
|
return postStream(`/api${prefix}/chat_message/${chat_id}`, { message })
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -71,7 +71,7 @@ allow="microphone">
|
|||||||
host: "${window.location.host}"
|
host: "${window.location.host}"
|
||||||
}
|
}
|
||||||
<\/script>
|
<\/script>
|
||||||
<script src="${window.location.origin}/ui/embed.js">
|
<script src="${window.location.origin}/ui/embeb.js">
|
||||||
<\/script>
|
<\/script>
|
||||||
`
|
`
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user