Skip to content

Commit 1b88383

Browse files
committed
🎨 Update system version retrieval in error.html to use process.getSystemVersion for better accuracy
1 parent 18a2909 commit 1b88383

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/electron/error.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,10 @@
240240
'win32': 'Windows',
241241
'linux': 'Linux'
242242
}[process.platform] || process.platform;
243-
243+
const release = typeof process.getSystemVersion === 'function'
244+
? process.getSystemVersion() // Electron 提供,系统版本
245+
: os.release(); // Node.js 提供,内核版本
244246
// Windows 系统版本判断
245-
const release = os.release();
246247
if (process.platform === 'win32') {
247248
const versionParts = release.split('.'); // 10.0.22000
248249
if (versionParts.length >= 3) {

0 commit comments

Comments
 (0)