diff --git a/apps/admin/.env.dev b/apps/admin/.env.dev index 6eea838..75238fd 100644 --- a/apps/admin/.env.dev +++ b/apps/admin/.env.dev @@ -3,9 +3,9 @@ # VITE_SERVICE_BASE_URL=http://192.168.5.140:9999 -# VITE_SERVICE_BASE_URL=https://api.qyzhjy.com +VITE_SERVICE_BASE_URL=http://api.ydzx.qyzhjy.com -VITE_SERVICE_BASE_URL=https://172.16.10.130:5000 +# VITE_SERVICE_BASE_URL=https://172.16.10.130:5000 VITE_OTHER_SERVICE_BASE_URL= `{ "demo": "http://localhost:9528" diff --git a/apps/admin/build/plugins/pwa.ts b/apps/admin/build/plugins/pwa.ts index e84ccff..c2b7d65 100644 --- a/apps/admin/build/plugins/pwa.ts +++ b/apps/admin/build/plugins/pwa.ts @@ -1,11 +1,24 @@ +import type { PluginOption } from 'vite' import { VitePWA } from 'vite-plugin-pwa' -export function setupPWA() { +export function setupPWA(): PluginOption { return VitePWA({ registerType: 'autoUpdate', + // 添加 devOptions 以便在开发环境调试 + devOptions: { + enabled: false, // 开发环境启用 + type: 'module', + }, workbox: { - globPatterns: ['**/*.{js,css,html,ico,png,svg,webp,jpg,jpeg}'], + // 排除大型 SVG 文件,避免预缓存 + globIgnores: [ + '**/team-title-bg*.svg', + '**/cover-bg-active*.svg', + '**/*-bg-animation*.svg', + ], + globPatterns: ['**/*.{js,css,html,ico,png,webp,jpg,jpeg}', '**/*.svg'], runtimeCaching: [ + // 字体缓存 { urlPattern: /^https:\/\/fonts\.googleapis\.com\/.*/i, handler: 'CacheFirst', @@ -17,34 +30,46 @@ export function setupPWA() { }, }, }, + // 大型 SVG 文件运行时缓存 + { + urlPattern: /.*\.(svg)$/, + handler: 'CacheFirst', + options: { + cacheName: 'svg-cache', + expiration: { + maxEntries: 50, + maxAgeSeconds: 60 * 60 * 24 * 30, // 30 days + }, + }, + }, + // 图片资源缓存 + { + urlPattern: /.*\.(png|jpg|jpeg|webp|gif)$/, + handler: 'CacheFirst', + options: { + cacheName: 'images-cache', + expiration: { + maxEntries: 100, + maxAgeSeconds: 60 * 60 * 24 * 30, // 30 days + }, + }, + }, ], }, includeAssets: ['favicon.ico', 'apple-touch-icon.png', 'masked-icon.svg'], manifest: { name: '阅读之星竞赛系统', short_name: '阅读之星', - description: '教育学会树人研究院阅读之星竞赛系统', + description: '树人研究院阅读之星竞赛系统', theme_color: '#ffffff', background_color: '#ffffff', display: 'standalone', orientation: 'landscape', icons: [ - { - src: 'pwa-192x192.png', - sizes: '192x192', - type: 'image/png', - }, - { - src: 'pwa-512x512.png', - sizes: '512x512', - type: 'image/png', - }, - { - src: 'pwa-512x512.png', - sizes: '512x512', - type: 'image/png', - purpose: 'any maskable', - }, + { src: 'images/pwa_logo_192.png', sizes: '192x192', type: 'image/png' }, + { src: 'images/pwa_logo_512.png', sizes: '512x512', type: 'image/png' }, + { src: 'images/pwa_logo_512.png', sizes: '512x512', type: 'image/png', purpose: 'any' }, + { src: 'images/pwa_logo_512.png', sizes: '512x512', type: 'image/png', purpose: 'maskable' }, ], }, }) diff --git a/apps/admin/index.html b/apps/admin/index.html index b04ac55..442f72c 100644 --- a/apps/admin/index.html +++ b/apps/admin/index.html @@ -2,7 +2,7 @@ - + %VITE_APP_TITLE% diff --git a/apps/admin/package.json b/apps/admin/package.json index 39e0f6a..8c1f4f4 100644 --- a/apps/admin/package.json +++ b/apps/admin/package.json @@ -16,7 +16,7 @@ "dev": "vite --mode dev", "dev:prod": "vite --mode prod", "gen-route": "sa gen-route", - "lint": "eslint . --fix", + "lint": "eslint src --fix", "prepare": "simple-git-hooks", "preview": "vite preview", "release": "sa release", diff --git a/apps/admin/public/favicon.ico b/apps/admin/public/favicon.ico new file mode 100644 index 0000000..a9aadf4 Binary files /dev/null and b/apps/admin/public/favicon.ico differ diff --git a/apps/admin/public/favicon.svg b/apps/admin/public/favicon.svg deleted file mode 100644 index dfaa6c8..0000000 --- a/apps/admin/public/favicon.svg +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/apps/admin/public/images/apple-touch-icon.png b/apps/admin/public/images/apple-touch-icon.png new file mode 100644 index 0000000..092eb4f Binary files /dev/null and b/apps/admin/public/images/apple-touch-icon.png differ diff --git a/apps/admin/public/images/favicon.ico b/apps/admin/public/images/favicon.ico new file mode 100644 index 0000000..a9aadf4 Binary files /dev/null and b/apps/admin/public/images/favicon.ico differ diff --git a/apps/admin/public/images/favicon.png b/apps/admin/public/images/favicon.png new file mode 100644 index 0000000..a3fbf57 Binary files /dev/null and b/apps/admin/public/images/favicon.png differ diff --git a/apps/admin/public/images/nonsupport.svg b/apps/admin/public/images/nonsupport.svg new file mode 100644 index 0000000..034e8d4 --- /dev/null +++ b/apps/admin/public/images/nonsupport.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/admin/public/images/pwa_logo_192.png b/apps/admin/public/images/pwa_logo_192.png new file mode 100644 index 0000000..8398711 Binary files /dev/null and b/apps/admin/public/images/pwa_logo_192.png differ diff --git a/apps/admin/public/images/pwa_logo_512.png b/apps/admin/public/images/pwa_logo_512.png new file mode 100644 index 0000000..e5d82ea Binary files /dev/null and b/apps/admin/public/images/pwa_logo_512.png differ diff --git a/apps/admin/report.html b/apps/admin/report.html new file mode 100644 index 0000000..3faf44e --- /dev/null +++ b/apps/admin/report.html @@ -0,0 +1,4950 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/apps/admin/src/components/custom/user/CompetitionLayout.vue b/apps/admin/src/components/custom/user/CompetitionLayout.vue index 87d0b06..20f0295 100644 --- a/apps/admin/src/components/custom/user/CompetitionLayout.vue +++ b/apps/admin/src/components/custom/user/CompetitionLayout.vue @@ -1,6 +1,6 @@