From 92fdd2df8e0379c828a04ec05e0020e60f2853b5 Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Tue, 11 Apr 2023 16:57:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96pc=E7=AB=AF=E6=89=93=E5=BC=80?= =?UTF-8?q?h5=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/public/mobile.html | 23 ++++++++++++ crmeb/route/route.php | 12 +++++- template/uni-app/App.vue | 8 ---- template/uni-app/static/html/pc.html | 55 ---------------------------- 4 files changed, 33 insertions(+), 65 deletions(-) create mode 100644 crmeb/public/mobile.html delete mode 100644 template/uni-app/static/html/pc.html diff --git a/crmeb/public/mobile.html b/crmeb/public/mobile.html new file mode 100644 index 000000000..f4d9b5be2 --- /dev/null +++ b/crmeb/public/mobile.html @@ -0,0 +1,23 @@ + + + + + <?=$siteName?> + + + + + + \ No newline at end of file diff --git a/crmeb/route/route.php b/crmeb/route/route.php index ccdf6de23..65503abc0 100644 --- a/crmeb/route/route.php +++ b/crmeb/route/route.php @@ -24,8 +24,16 @@ Route::miss(function () { case 'pages': return view(app()->getRootPath() . 'public' . DS . 'index.html'); default: - if (!request()->isMobile() && is_dir(app()->getRootPath() . 'public' . DS . 'home') && !request()->get('type')) { - return view(app()->getRootPath() . 'public' . DS . 'home' . DS . 'index.html'); + if (!request()->isMobile()) { + if (is_dir(app()->getRootPath() . 'public' . DS . 'home') && !request()->get('type')) { + return view(app()->getRootPath() . 'public' . DS . 'home' . DS . 'index.html'); + } else { + if (request()->get('type')) { + return view(app()->getRootPath() . 'public' . DS . 'index.html'); + } else { + return view(app()->getRootPath() . 'public' . DS . 'mobile.html', ['siteName' => sys_config('site_name'), 'siteUrl' => sys_config('site_url') . '/pages/index/index']); + } + } } else { return view(app()->getRootPath() . 'public' . DS . 'index.html'); } diff --git a/template/uni-app/App.vue b/template/uni-app/App.vue index 85cba6b6d..bb19b2424 100644 --- a/template/uni-app/App.vue +++ b/template/uni-app/App.vue @@ -246,14 +246,6 @@ // #endif // #ifdef H5 - uni.getSystemInfo({ - success(e) { - /* 窗口宽度大于420px且不在PC页面且不在移动设备时跳转至 PC.html 页面 */ - if (e.windowWidth > 420 && !window.top.isPC && !/iOS|Android/i.test(e.system)) { - window.location.pathname = '/static/html/pc.html'; - } - } - }); if (option.query.hasOwnProperty('type') && option.query.type == "iframeWindow") { this.globalData.isIframe = true; } else { diff --git a/template/uni-app/static/html/pc.html b/template/uni-app/static/html/pc.html deleted file mode 100644 index 89a13f10c..000000000 --- a/template/uni-app/static/html/pc.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - crmeb-PC端 - - - - - - - - - - - \ No newline at end of file