From 303251f6cb2783452962ad52500058bf7c76b5b6 Mon Sep 17 00:00:00 2001 From: shaohuzhang1 Date: Wed, 20 Dec 2023 15:43:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B5=8C=E5=85=A5=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E6=B7=BB=E5=8A=A0=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/public/embeb.js | 7 ++++--- .../views/applicaiton-overview/component/EmbedDialog.vue | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ui/public/embeb.js b/ui/public/embeb.js index bd2edf887..b4f79f010 100644 --- a/ui/public/embeb.js +++ b/ui/public/embeb.js @@ -1,6 +1,6 @@ function embedChatbot() { const t = window.maxkbChatConfig - if (t && t.token) { + if (t && t.token&&t.protocol&&t.host) { icon = ` @@ -41,7 +41,8 @@ chat_container.style["display"] = "none"; chat = document.createElement("iframe"); - chat.src = `http://${window.maxkbChatConfig.host}/ui/chat/${window.maxkbChatConfig.token}`; + + chat.src = `${window.maxkbChatConfig.protocol}//${window.maxkbChatConfig.host}/ui/chat/${window.maxkbChatConfig.token}`; chat.id = "chat"; chat_container.append(chat); chat.style.cssText = `border: none;height:100%;width:100%`; @@ -83,6 +84,6 @@ }` document.head.append(sty) document.body.append(chat_button); - } else console.error('difyChatbotConfig is empty or token is not provided') + } else console.error('invalid parameter') } document.body.onload = embedChatbot diff --git a/ui/src/views/applicaiton-overview/component/EmbedDialog.vue b/ui/src/views/applicaiton-overview/component/EmbedDialog.vue index db1264ca5..d7b97db5c 100644 --- a/ui/src/views/applicaiton-overview/component/EmbedDialog.vue +++ b/ui/src/views/applicaiton-overview/component/EmbedDialog.vue @@ -68,7 +68,8 @@ allow="microphone"> ` source2.value = `