From 209ad702ef0264b1cf5196ec11eec7a21e9a6a2a Mon Sep 17 00:00:00 2001 From: fuxiaochun Date: Thu, 17 Aug 2023 20:18:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=BE=E5=A4=87=E6=A3=80?= =?UTF-8?q?=E6=B5=8B=E6=9B=B4=E6=8D=A2=E5=9C=B0=E5=9D=80=E5=9F=9F=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.js b/src/main.js index 4a084ac..80039a0 100644 --- a/src/main.js +++ b/src/main.js @@ -20,7 +20,10 @@ function platCheck() { const mobileKeywords = ['iphone', 'ipod', 'android', 'silk', 'blackberry', 'bb10', 'phone', 'mobile', 'kindle', 'opera mini', 'mobile safari', 'windows phone']; const isMobileDevice = mobileKeywords.some(keyword => userAgent.includes(keyword)); if (!isMobileDevice) { - window.location.href = import.meta.env.VITE_PC_HOST; + let _href = window.location.href; + let _origin = window.location.origin; + _href.replace(_origin, import.meta.env.VITE_PC_HOST) + window.location.href = _href; } } platCheck();