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 = `