From af04a955e7a470be93c04aaafd5dbfe096768157 Mon Sep 17 00:00:00 2001 From: yezian Date: Tue, 24 Dec 2024 20:06:28 +0800 Subject: [PATCH] revert 6710fd8c4fcb0aa6bff558cd31026f75ff02c43b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit revert ios版本若大于17则不展示下载按钮 --- app/page.jsx | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/app/page.jsx b/app/page.jsx index 16265d1..af07e33 100644 --- a/app/page.jsx +++ b/app/page.jsx @@ -11,25 +11,14 @@ import { generateSignature } from "@/utils/crypto"; export default function Home() { const [deviceType, setDeviceType] = useState(""); const [installInfo, setInstallInfo] = useState({}); - const [isIosVersionGreaterThan17, setIsIosVersionGreaterThan17] = - useState(false); useEffect(() => { const userAgent = navigator.userAgent; - console.log(userAgent); //区分设备类型 if (/Android/i.test(userAgent)) { setDeviceType("Android"); } else if (/iPhone|iPad|iPod/i.test(userAgent)) { setDeviceType("ios"); - //区分ios版本号是否小于18,小于18则不展示下载按钮 - const version = userAgent - .toLowerCase() - .match(/cpu iphone os (.*?) like mac os/); - if (version) { - const mainVersion = parseInt(version[1].split("_")[0], 10); - mainVersion > 17 && setIsIosVersionGreaterThan17(true); - } } else { setDeviceType("pc"); } @@ -215,8 +204,7 @@ export default function Home() { )} {(deviceType === "Android" || (deviceType === "ios" && - installInfo?.is_ios_install_button_visible === 1 && - !isIosVersionGreaterThan17)) && ( + installInfo?.is_ios_install_button_visible === 1)) && (