diff --git a/main/manager-mobile/favicon.ico b/main/manager-mobile/favicon.ico index 47c577c9..d75b65c3 100644 Binary files a/main/manager-mobile/favicon.ico and b/main/manager-mobile/favicon.ico differ diff --git a/main/manager-web/.env.production b/main/manager-web/.env.production index 351d791a..665ffe7f 100644 --- a/main/manager-web/.env.production +++ b/main/manager-web/.env.production @@ -1,4 +1,7 @@ VUE_APP_API_BASE_URL=/xiaozhi + VUE_APP_PUBLIC_PATH=/ # 是否开启CDN -VUE_APP_USE_CDN=false \ No newline at end of file +VUE_APP_USE_CDN=false + +VITE_H5_URL = https://2662r3426b.vicp.fun/h5/index.html \ No newline at end of file diff --git a/main/manager-web/src/App.vue b/main/manager-web/src/App.vue index 29970c96..79b853c6 100644 --- a/main/manager-web/src/App.vue +++ b/main/manager-web/src/App.vue @@ -60,6 +60,13 @@ export default { }; }, mounted() { + // 检测是否为移动设备,如果是则跳转到H5页面 + if (this.isMobileDevice()) { + const h5Url = process.env.VITE_H5_URL || 'https://2662r3426b.vicp.fun/h5/index.html'; + window.location.href = h5Url; + return; + } + // 只有在启用CDN时才添加相关事件和功能 if (this.isCDNEnabled) { // 添加全局快捷键Alt+C用于显示缓存查看器 @@ -101,6 +108,11 @@ export default { this.showCacheViewer = true; } }, + isMobileDevice() { + // 检测是否为移动设备的函数 + return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); + }, + async checkServiceWorkerStatus() { // 检查Service Worker是否已注册 if ('serviceWorker' in navigator) {