From 94273d80b0a9128ef774552ab812bc594a62cfd7 Mon Sep 17 00:00:00 2001 From: linyuchen Date: Sun, 12 May 2024 20:32:36 +0800 Subject: [PATCH] refactor: Random os hostname --- src/common/utils/system.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/utils/system.ts b/src/common/utils/system.ts index a0873b0a..63818422 100644 --- a/src/common/utils/system.ts +++ b/src/common/utils/system.ts @@ -4,9 +4,9 @@ import path from 'node:path'; // 缓解Win7设备兼容性问题 let osName: string; try { - osName = os.hostname(); + osName = os.hostname(); } catch (e) { - osName = "NapCat" + osName = 'NapCat ' + crypto.randomUUID().substring(0, 4); } export const systemPlatform = os.platform();