🐛 Fix ws security blocked

This commit is contained in:
2024-06-26 21:20:57 +08:00
parent e36b40614d
commit 4281952c87
2 changed files with 7 additions and 5 deletions

View File

@ -39,7 +39,8 @@ export const useNotifications = defineStore("notifications", () => {
async function connect() {
if (!(checkLoggedIn())) return
const uri = `ws://${window.location.host}/api/ws`
const protocol = location.protocol.replace("http", "ws")
const uri = `${protocol}//${window.location.host}/api/ws`
socket = new WebSocket(uri + `?tk=${getAtk() as string}`)