!58 修复vite环境变量类型原因导致websocket关闭失效问题

Merge pull request !58 from Lau/N/A
This commit is contained in:
疯狂的狮子Li 2023-11-16 04:24:52 +00:00 committed by Gitee
commit d84fee9319
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 2 additions and 2 deletions

2
src/types/env.d.ts vendored
View File

@ -69,7 +69,7 @@ interface ImportMetaEnv {
VITE_APP_ENV: string;
VITE_APP_RSA_PUBLIC_KEY: string;
VITE_APP_CLIENT_ID: string;
VITE_APP_WEBSOCKET: boolean;
VITE_APP_WEBSOCKET: string;
}
interface ImportMeta {
readonly env: ImportMetaEnv;

View File

@ -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 === 'false') {
return;
}
socketUrl = url;