使用 HTTPS 协议访问认证页面时无法建立 Web Socket 连接 (#7161)

This commit is contained in:
颖逸 2023-01-25 19:46:25 +08:00 committed by GitHub
parent be585435e2
commit 3f87f3da5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -529,7 +529,7 @@
}
// 用于授权页保持连接,避免非常驻内存内核自动退出 https://github.com/siyuan-note/insider/issues/1099
new WebSocket(window.location.protocol === 'https:' ? 'wss' : 'ws' + '://' + window.location.host + '/ws?app=siyuan&id=auth')
new WebSocket(`${window.location.protocol === 'https:' ? 'wss' : 'ws'}://${window.location.host}/ws?app=siyuan&id=auth`)
</script>
</body>
</html>