Skip to content

Commit 1760c47

Browse files
committed
📝 移除自动识别平台
1 parent 1801f78 commit 1760c47

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

docs/app/components/Download.tsx

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -35,33 +35,33 @@ export default function Download() {
3535
);
3636
}
3737

38-
function detectPlatformAndArch() {
39-
// 检测操作系统
40-
const platform = navigator.platform;
41-
let os;
42-
if (platform.includes("Win")) {
43-
os = "windows";
44-
} else if (platform.includes("Mac")) {
45-
os = "darwin";
46-
} else if (platform.includes("Linux")) {
47-
os = "linux";
48-
} else {
49-
os = "unknown";
50-
}
38+
// function detectPlatformAndArch() {
39+
// // 检测操作系统
40+
// const platform = navigator.platform;
41+
// let os;
42+
// if (platform.includes("Win")) {
43+
// os = "windows";
44+
// } else if (platform.includes("Mac")) {
45+
// os = "darwin";
46+
// } else if (platform.includes("Linux")) {
47+
// os = "linux";
48+
// } else {
49+
// os = "unknown";
50+
// }
5151

52-
// 检测CPU架构(间接推断)
53-
const userAgent = navigator.userAgent;
54-
let arch = "unknown";
55-
if (/aarch64|arm64/i.test(userAgent)) {
56-
arch = "aarch64";
57-
} else if (/x86_64|x64|win64|wow64/i.test(userAgent)) {
58-
arch = "x86_64";
59-
} else if (/x86|i386|i686|win32/i.test(userAgent)) {
60-
arch = "x86";
61-
}
52+
// // 检测CPU架构(间接推断)
53+
// const userAgent = navigator.userAgent;
54+
// let arch = "unknown";
55+
// if (/aarch64|arm64/i.test(userAgent)) {
56+
// arch = "aarch64";
57+
// } else if (/x86_64|x64|win64|wow64/i.test(userAgent)) {
58+
// arch = "x86_64";
59+
// } else if (/x86|i386|i686|win32/i.test(userAgent)) {
60+
// arch = "x86";
61+
// }
6262

63-
return `${os}-${arch}`;
64-
}
63+
// return `${os}-${arch}`;
64+
// }
6565

6666
const platformMap = {
6767
"windows-x86_64": "Windows",
@@ -76,7 +76,7 @@ const formatMap = {
7676
function Downloads({ data }: { data: Record<string, Record<string, string>> }) {
7777
return (
7878
<div className="flex flex-col gap-3">
79-
<div className="flex flex-wrap gap-3">
79+
{/* <div className="flex flex-wrap gap-3">
8080
{Object.entries(data[detectPlatformAndArch()]).map(([format, url]) => (
8181
<a
8282
key={format}
@@ -90,10 +90,10 @@ function Downloads({ data }: { data: Record<string, Record<string, string>> }) {
9090
</div>
9191
</a>
9292
))}
93-
</div>
93+
</div> */}
9494
<div className="flex flex-wrap gap-3">
9595
{Object.entries(data)
96-
.filter(([key]) => key !== detectPlatformAndArch())
96+
// .filter(([key]) => key !== detectPlatformAndArch())
9797
.map(([platform, formats]) =>
9898
Object.entries(formats).map(([format, url]) => (
9999
<a

0 commit comments

Comments
 (0)