mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
22 lines
514 B
TypeScript
22 lines
514 B
TypeScript
import os from 'node:os';
|
|
import path from 'node:path';
|
|
|
|
// 缓解Win7设备兼容性问题
|
|
let osName: string;
|
|
|
|
try {
|
|
osName = os.hostname();
|
|
} catch (e) {
|
|
osName = 'NapCat'; // + crypto.randomUUID().substring(0, 4);
|
|
}
|
|
|
|
|
|
const homeDir = os.homedir();
|
|
|
|
export const systemPlatform = os.platform();
|
|
export const cpuArch = os.arch();
|
|
export const systemVersion = os.release();
|
|
export const hostname = osName;
|
|
export const downloadsPath = path.join(homeDir, 'Downloads');
|
|
export const systemName = os.type();
|