diff --git a/src/types/env.d.ts b/src/types/env.d.ts index fabf641..8389dc5 100644 --- a/src/types/env.d.ts +++ b/src/types/env.d.ts @@ -69,6 +69,7 @@ interface ImportMetaEnv { VITE_APP_ENV: string; VITE_APP_RSA_PUBLIC_KEY: string; VITE_APP_CLIENT_ID: string; + VITE_APP_WEBSOCKET: boolean; } interface ImportMeta { readonly env: ImportMetaEnv; diff --git a/src/utils/websocket.ts b/src/utils/websocket.ts index a2fcee7..5ba0243 100644 --- a/src/utils/websocket.ts +++ b/src/utils/websocket.ts @@ -33,7 +33,7 @@ let socketError = 0 as number; // 错误次数 // 初始化socket export const initWebSocket = (url: any) => { - if (import.meta.env.VITE_APP_WEBSOCKET) { + if (!import.meta.env.VITE_APP_WEBSOCKET) { return; } socketUrl = url;