feat: add auto reg to widget

This commit is contained in:
Tristan Yang
2023-11-17 20:47:17 +08:00
parent cc636ad86b
commit 128fac9427
8 changed files with 93 additions and 56 deletions
+4 -1
View File
@@ -2,6 +2,7 @@
((w, d) => {
const {
hostId = 1,
autoReg = "false",
closeWidth = 48,
closeHeight = 48,
openWidth = 380,
@@ -24,7 +25,9 @@
boxShadow: `rgb(0 0 0 / 25%) 0px 25px 50px -12px`
};
Object.assign(wrapper.style, styles);
wrapper.src = `${new URL(_src).origin}/widget.html?host=${hostId}&themeColor=${encodeURIComponent(
wrapper.src = `${
new URL(_src).origin
}/widget.html?host=${hostId}&autoReg=${autoReg}&themeColor=${encodeURIComponent(
themeColor
)}&from=${encodeURIComponent(location.hostname)}&welcome=${encodeURIComponent(welcome)}`;
wrapper.width = closeWidth;