feat: login from token in widget

This commit is contained in:
Tristan Yang
2023-11-21 09:26:47 +08:00
parent 128fac9427
commit abf0ced2f9
9 changed files with 361 additions and 364 deletions
+2 -1
View File
@@ -3,6 +3,7 @@
const {
hostId = 1,
autoReg = "false",
loginToken = "",
closeWidth = 48,
closeHeight = 48,
openWidth = 380,
@@ -27,7 +28,7 @@
Object.assign(wrapper.style, styles);
wrapper.src = `${
new URL(_src).origin
}/widget.html?host=${hostId}&autoReg=${autoReg}&themeColor=${encodeURIComponent(
}/widget.html?host=${hostId}&autoReg=${autoReg}&token=${loginToken}&themeColor=${encodeURIComponent(
themeColor
)}&from=${encodeURIComponent(location.hostname)}&welcome=${encodeURIComponent(welcome)}`;
wrapper.width = closeWidth;