修改设备检测更换地址域名
parent
f20115dca8
commit
209ad702ef
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue