From e7bec7d6b0be0bb91d2c4ce0f1c7e10131826bcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Tue, 17 Sep 2024 22:24:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20systemPlatform=E6=A0=87=E5=87=86?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/index.ts | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/core/index.ts b/src/core/index.ts index e8688dfa..6e60a053 100644 --- a/src/core/index.ts +++ b/src/core/index.ts @@ -251,18 +251,31 @@ export async function genSessionConfig(QQVersionAppid: string, QQVersion: string const downloadPath = path.join(account_path, 'NapCat', 'temp'); fs.mkdirSync(downloadPath, { recursive: true }); const guid: string = await getMachineId();//26702 支持JS获取guid值 在LoginService中获取 TODO mlikiow a + //os.platform() + let systemPlatform = PlatformType.KWINDOWS; + switch (os.platform()) { + case 'win32': + systemPlatform = PlatformType.KWINDOWS; + break; + case 'darwin': + systemPlatform = PlatformType.KMAC; + break; + case 'linux': + systemPlatform = PlatformType.KANDROID; //Android 怎么不算Linux! + break; + } return { selfUin, selfUid, desktopPathConfig: { account_path, // 可以通过NodeQQNTWrapperUtil().getNTUserDataInfoConfig()获取 }, - clientVer: QQVersion, // 9.9.8-22355 + clientVer: QQVersion, a2: '', d2: '', d2Key: '', machineId: '', - platform: PlatformType.KWINDOWS, // 3是Windows? + platform: systemPlatform, // 3是Windows? platVer: systemVersion, // 系统版本号, 应该可以固定 appid: QQVersionAppid, rdeliveryConfig: { @@ -270,7 +283,7 @@ export async function genSessionConfig(QQVersionAppid: string, QQVersion: string systemId: 0, appId: '', logicEnvironment: '', - platform: PlatformType.KWINDOWS, + platform: systemPlatform, language: '', sdkVersion: '', userId: '',