fix: windows style

This commit is contained in:
GyDi
2022-03-22 01:36:06 +08:00
parent dd605e2610
commit bd0a959e18
3 changed files with 25 additions and 7 deletions

13
src/utils/get-system.ts Normal file
View File

@@ -0,0 +1,13 @@
// get the system os
// according to UA
export default function getSystem() {
const ua = navigator.userAgent;
if (ua.includes("Mac OS X")) return "macos";
if (/win64|win32/i.test(ua)) return "windows";
if (/linux/i.test(ua)) return "linux";
return "unknown";
}