From 7870c835d7d31c976d9f05fa15ec81d2aa526075 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Sun, 2 Jun 2024 01:02:30 +0800 Subject: [PATCH] fix: rename all disableSocketMsgpack to disableMsgpack --- client/shared/api/socket.ts | 4 ++-- client/shared/model/config.ts | 2 +- client/shared/utils/consts.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/shared/api/socket.ts b/client/shared/api/socket.ts index 8a190b39..ba57624f 100644 --- a/client/shared/api/socket.ts +++ b/client/shared/api/socket.ts @@ -208,14 +208,14 @@ export function createSocket(token: string): Promise { } return new Promise((resolve, reject) => { - const disableSocketMsgpack = getGlobalConfig().disableSocketMsgpack; + const disableMsgpack = getGlobalConfig().disableMsgpack; _socket = io(getServiceUrl(), { transports: ['websocket'], auth: { token, }, forceNew: true, - parser: disableSocketMsgpack ? undefined : msgpackParser, + parser: disableMsgpack ? undefined : msgpackParser, }); _socket.once('connect', () => { // 连接成功 diff --git a/client/shared/model/config.ts b/client/shared/model/config.ts index bc0d0c74..f1eea1c3 100644 --- a/client/shared/model/config.ts +++ b/client/shared/model/config.ts @@ -37,7 +37,7 @@ export interface GlobalConfig { /** * 是否禁用 Socketio 的 Msgpack 解析器 */ - disableSocketMsgpack?: boolean; + disableMsgpack?: boolean; /** * 是否禁用注册功能 diff --git a/client/shared/utils/consts.ts b/client/shared/utils/consts.ts index 82e3e602..11b44fa6 100644 --- a/client/shared/utils/consts.ts +++ b/client/shared/utils/consts.ts @@ -23,7 +23,7 @@ export const defaultGlobalConfig: GlobalConfig = { uploadFileLimit: 1 * 1024 * 1024, emailVerification: false, serverName: 'Tailchat', - disableSocketMsgpack: false, + disableMsgpack: false, disableUserRegister: false, disableGuestLogin: false, disableCreateGroup: false,