Ver código fonte

debug: add console logs for WebSocket URLs

unknown 3 dias atrás
pai
commit
e6064a3cf3
2 arquivos alterados com 2 adições e 1 exclusões
  1. 1 0
      src/components/OrderChat.vue
  2. 1 1
      src/stores/auth.ts

+ 1 - 0
src/components/OrderChat.vue

@@ -138,6 +138,7 @@ function connectWebSocket() {
   const token = localStorage.getItem("token");
   if (!token) return;
 
+  console.log("DEBUG: Connecting to Order Chat at:", `${WS_BASE_URL}/chat`);
   ws = new WebSocket(`${WS_BASE_URL}/chat?token=${encodeURIComponent(token)}&order_id=${props.orderId}`);
 
   ws.onopen = () => {

+ 1 - 1
src/stores/auth.ts

@@ -142,7 +142,7 @@ export const useAuthStore = defineStore("auth", () => {
     stopPing(); // Ensure fresh start
     const token = localStorage.getItem("token");
     if (!token || wsAuthFailed.value) return;
-
+    console.log("DEBUG: Connecting to WebSocket at:", `${WS_BASE_URL}/global`);
     globalWs = new WebSocket(`${WS_BASE_URL}/global?token=${encodeURIComponent(token)}`);
 
     globalWs.onopen = () => {