mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-03-25 07:16:51 +00:00
一些更新
This commit is contained in:
@@ -35,7 +35,7 @@ class CloudControlService {
|
||||
private async reportOnline() {
|
||||
const data: UsageStats = {
|
||||
appVersion: app.getVersion(),
|
||||
platform: process.platform,
|
||||
platform: this.getPlatformVersion(),
|
||||
deviceId: this.deviceId,
|
||||
timestamp: Date.now(),
|
||||
online: true,
|
||||
@@ -46,6 +46,29 @@ class CloudControlService {
|
||||
this.pages.clear()
|
||||
}
|
||||
|
||||
private getPlatformVersion(): string {
|
||||
const os = require('os')
|
||||
const platform = process.platform
|
||||
|
||||
if (platform === 'win32') {
|
||||
const release = os.release()
|
||||
const parts = release.split('.')
|
||||
const major = parseInt(parts[0])
|
||||
const minor = parseInt(parts[1] || '0')
|
||||
const build = parseInt(parts[2] || '0')
|
||||
|
||||
// Windows 11 是 10.0.22000+,且主版本必须是 10.0
|
||||
if (major === 10 && minor === 0 && build >= 22000) {
|
||||
return 'Windows 11'
|
||||
} else if (major === 10) {
|
||||
return 'Windows 10'
|
||||
}
|
||||
return `Windows ${release}`
|
||||
}
|
||||
|
||||
return platform
|
||||
}
|
||||
|
||||
recordPage(pageName: string) {
|
||||
this.pages.add(pageName)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user