Skip to content

Commit 75b0bb1

Browse files
committed
fix: Support embedding multiple Applications
Closes #1659
1 parent 0724fde commit 75b0bb1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

apps/application/template/embed.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
(function() {
12
const guideHtml=`
23
<div class="maxkb-mask">
34
<div class="maxkb-content"></div>
@@ -23,7 +24,7 @@ const chatButtonHtml=
2324
<img style="height:100%;width:100%;" src="{{float_icon}}">
2425
</div>`
2526

26-
27+
2728

2829
const getChatContainerHtml=(protocol,host,token,query)=>{
2930
return `<div id="maxkb-chat-container">
@@ -43,7 +44,7 @@ const getChatContainerHtml=(protocol,host,token,query)=>{
4344
}
4445
/**
4546
* 初始化引导
46-
* @param {*} root
47+
* @param {*} root
4748
*/
4849
const initGuide=(root)=>{
4950
root.insertAdjacentHTML("beforeend",guideHtml)
@@ -142,7 +143,7 @@ function initMaxkb(){
142143
initChat(root)
143144
}
144145

145-
146+
146147
// 初始化全局样式
147148
function initMaxkbStyle(root){
148149
style=document.createElement('style')
@@ -319,3 +320,4 @@ function embedChatbot() {
319320
} else console.error('invalid parameter')
320321
}
321322
window.addEventListener('load',embedChatbot)
323+
})();

0 commit comments

Comments
 (0)