|
|
@@ -8,34 +8,11 @@
|
|
|
/>
|
|
|
<script>
|
|
|
function isPC () {
|
|
|
- const ua = navigator.userAgent;
|
|
|
- const platform = navigator.platform;
|
|
|
-
|
|
|
- // 移动设备检测
|
|
|
- const mobileRegex = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile|mobile|CriOS/i;
|
|
|
- const isMobile = mobileRegex.test(ua);
|
|
|
-
|
|
|
- // 平板设备检测
|
|
|
- const tabletRegex = /iPad|Tablet|PlayBook|Silk|Kindle|(Android(?!.*Mobile))|(Windows(?!.*Phone))(.*Touch)/i;
|
|
|
- const isTablet = tabletRegex.test(ua);
|
|
|
|
|
|
// 屏幕尺寸检测
|
|
|
const isSmallScreen = window.innerWidth < 768;
|
|
|
|
|
|
- // 触摸支持检测
|
|
|
- const hasTouch = 'ontouchstart' in window || navigator.maxTouchPoints > 0;
|
|
|
-
|
|
|
- // 如果是移动设备、平板设备、小屏幕设备,则不是PC
|
|
|
- if (isMobile || isTablet || isSmallScreen) {
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- // 额外的PC特征检测
|
|
|
- const isWindows = /Win/i.test(platform);
|
|
|
- const isMac = /Mac/i.test(platform);
|
|
|
- const isLinux = /Linux/i.test(platform);
|
|
|
-
|
|
|
- return (isWindows || isMac || isLinux) && !hasTouch;
|
|
|
+ return !isSmallScreen;
|
|
|
}
|
|
|
if (isPC()) {
|
|
|
window.location.replace('https://callweb.wefanbot.com')
|