mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
feat: 后端支持嵌入第三方
This commit is contained in:
parent
1e2ed4af88
commit
5488804ea8
|
|
@ -47,7 +47,7 @@ MIDDLEWARE = [
|
|||
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||
'django.middleware.common.CommonMiddleware',
|
||||
'django.contrib.messages.middleware.MessageMiddleware',
|
||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||
|
||||
]
|
||||
|
||||
JWT_AUTH = {
|
||||
|
|
|
|||
|
|
@ -77,7 +77,9 @@ def page_not_found(request, exception):
|
|||
file = open(index_path, "r", encoding='utf-8')
|
||||
content = file.read()
|
||||
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
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
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}"
|
||||
}
|
||||
<\/script>
|
||||
<script src="${window.location.origin}/ui/embed.js">
|
||||
<script src="${window.location.origin}/ui/embeb.js">
|
||||
<\/script>
|
||||
`
|
||||
dialogVisible.value = true
|
||||
|
|
|
|||
Loading…
Reference in New Issue