🐛 Fix ws security blocked

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

View File

@ -4,8 +4,9 @@
<option name="autoReloadType" value="ALL" />
</component>
<component name="ChangeListManager">
<list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":sparkles: Get myself current status API">
<change beforePath="$PROJECT_DIR$/pkg/internal/server/api/index.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/server/api/index.go" afterDir="false" />
<list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":bug: Fix miscall function">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/web/src/stores/notifications.ts" beforeDir="false" afterPath="$PROJECT_DIR$/web/src/stores/notifications.ts" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -151,7 +152,6 @@
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value=":bug: Fix registration service issue" />
<MESSAGE value=":bug: Fix avatar url missing endpoint prefix" />
<MESSAGE value=":ambulance: Fix query services too much 429" />
<MESSAGE value=":ambulance: Fix nil map panic" />
@ -176,7 +176,8 @@
<MESSAGE value=":bug: Fix clear status affected the statutes cleared before" />
<MESSAGE value=":sparkles: Get self-current status API" />
<MESSAGE value=":sparkles: Get myself current status API" />
<option name="LAST_COMMIT_MESSAGE" value=":sparkles: Get myself current status API" />
<MESSAGE value=":bug: Fix miscall function" />
<option name="LAST_COMMIT_MESSAGE" value=":bug: Fix miscall function" />
</component>
<component name="VgoProject">
<settings-migrated>true</settings-migrated>

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}`)