修改设备检测更换地址域名

master
fuxiaochun 2023-08-17 20:18:58 +08:00
parent f20115dca8
commit 209ad702ef
1 changed files with 4 additions and 1 deletions

View File

@ -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();