This commit is contained in:
24kycj
2026-05-12 21:42:42 +08:00
parent 31c9d64ba9
commit 68d1968376
21 changed files with 1120 additions and 273 deletions
+4 -2
View File
@@ -3,8 +3,9 @@
* 处理不同操作系统的文件大小差异
*/
// 检测操作系统
// 检测操作系统(网页端无 process.platform,返回 'web'
export function getOS() {
if (typeof process === 'undefined' || process.platform === undefined) return 'web'
const platform = process.platform
if (platform === 'win32') return 'windows'
if (platform === 'darwin') return 'mac'
@@ -20,7 +21,8 @@ export function getBaseSize() {
const baseSizes = {
windows: 1024, // Windows 使用 1024 进制 (二进制)
mac: 1024, // macOS 使用 1024 进制 (十进制)
linux: 1024 // Linux 使用 1024 进制 (十进制,遵循 SI 标准)
linux: 1024, // Linux 使用 1024 进制 (十进制,遵循 SI 标准)
web: 1024 // 网页端固定 1024
}
return baseSizes[os] || 1024