diff --git a/mail-vue/index.html b/mail-vue/index.html index 72bcce3..48085d7 100644 --- a/mail-vue/index.html +++ b/mail-vue/index.html @@ -3,7 +3,7 @@ - + @@ -16,7 +16,7 @@ root.setAttribute('class', uiStore.dark ? 'dark' : ''); const metaTag = document.getElementById('theme-color-meta'); const isMobile = !window.matchMedia("(pointer: fine) and (hover: hover)").matches; - metaTag.setAttribute('content', uiStore.dark ? (isMobile ? '#141414' : '#000000') : (isMobile ? '#FFFFFF' : '#D3E3FD')); + metaTag.setAttribute('content', uiStore.dark ? (isMobile ? '#141414' : '#000000') : (isMobile ? '#FFFFFF' : '#F1F1F1')); } diff --git a/mail-vue/src/layout/header/index.vue b/mail-vue/src/layout/header/index.vue index 8fb776f..01eff78 100644 --- a/mail-vue/src/layout/header/index.vue +++ b/mail-vue/src/layout/header/index.vue @@ -231,7 +231,7 @@ function switchDark(nextIsDark, root) { root.setAttribute('class', nextIsDark ? 'dark' : '') const metaTag = document.getElementById('theme-color-meta'); const isMobile = !window.matchMedia("(pointer: fine) and (hover: hover)").matches; - metaTag.setAttribute('content', nextIsDark ? (isMobile ? '#141414' : '#000000') : (isMobile ? '#FFFFFF' : '#D3E3FD')); + metaTag.setAttribute('content', nextIsDark ? (isMobile ? '#141414' : '#000000') : (isMobile ? '#FFFFFF' : '#F1F1F1')); uiStore.dark = nextIsDark } diff --git a/mail-vue/vite.config.js b/mail-vue/vite.config.js index 1061eb7..05bb2b5 100644 --- a/mail-vue/vite.config.js +++ b/mail-vue/vite.config.js @@ -17,8 +17,7 @@ export default defineConfig(({mode}) => { base: env.VITE_STATIC_URL || '/', plugins: [vue(), VitePWA({ - registerType: 'autoUpdate', // 配置 service worker 的注册方式 - includeAssets: ['favicon.svg', 'robots.txt'], // 指定需要包含的静态资源 + injectRegister: 'script-defer', manifest: { name: env.VITE_PWA_NAME, short_name: env.VITE_PWA_NAME, @@ -26,19 +25,13 @@ export default defineConfig(({mode}) => { theme_color: '#FFFFFF', icons: [ { - src: 'mail-pwa.png',//像素尺寸一定要对应 + src: 'mail-pwa.png', sizes: '192x192', type: 'image/png', } ], }, - workbox: { - disableDevLogs: true, - globPatterns: [], - runtimeCaching: [], - navigateFallback: null, - cleanupOutdatedCaches: true, - } + workbox: false }), AutoImport({ resolvers: [ElementPlusResolver()],