From 2bc7e3dba36718015f39e374afe8c2b5fd89c6c3 Mon Sep 17 00:00:00 2001 From: maochaoying <925670706@qq.com> Date: Thu, 20 Apr 2023 11:55:48 +0800 Subject: [PATCH] 123 --- index.html | 28 ++++++++++++++-------------- src/App.vue | 4 ---- src/common/utils.js | 7 ------- src/entry-client.js | 9 +++++++++ stats.html | 2 +- 5 files changed, 24 insertions(+), 26 deletions(-) create mode 100644 src/entry-client.js diff --git a/index.html b/index.html index 9dac426..4e0e5b6 100644 --- a/index.html +++ b/index.html @@ -8,22 +8,22 @@ /> 产品梦工厂 - - +
- + + diff --git a/src/App.vue b/src/App.vue index 74b4d5e..afac8cb 100644 --- a/src/App.vue +++ b/src/App.vue @@ -9,12 +9,8 @@ import QRCode from 'cpns/QRCode' import { toAnchor } from '@/common/utils' import { useSwiperStore } from '@/store' import { onMounted } from 'vue' -import { _isMobile } from '@/common/utils' const swiperStore = useSwiperStore() onMounted(() => { - if (_isMobile()) { - window.location.href = 'https://www.iflytop.com/mobile/' - } window.addEventListener( 'popstate', function (event) { diff --git a/src/common/utils.js b/src/common/utils.js index 192143f..985a4c0 100644 --- a/src/common/utils.js +++ b/src/common/utils.js @@ -304,10 +304,3 @@ export const toAnchor = url => { return 16 } } - -export const _isMobile = () => { - let flag = navigator.userAgent.match( - /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i, - ) - return flag -} diff --git a/src/entry-client.js b/src/entry-client.js new file mode 100644 index 0000000..e300863 --- /dev/null +++ b/src/entry-client.js @@ -0,0 +1,9 @@ +if ( + /(Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini)/i.test( + navigator.userAgent, + ) +) { + window.location.href = 'https://www.iflytop.com/mobile/' +} else { + import('./main.js') +} diff --git a/stats.html b/stats.html index e73d750..21b2794 100644 --- a/stats.html +++ b/stats.html @@ -6157,7 +6157,7 @@ var drawChart = (function (exports) {