1
0
mirror of https://github.com/ZeroCatDev/Classworks.git synced 2025-07-02 00:59:23 +00:00

路径改为相对路径

This commit is contained in:
SunWuyuan 2025-06-11 15:45:17 +08:00
parent 0f9ad4f81a
commit f66031cd18
No known key found for this signature in database
GPG Key ID: A6A54CF66F56BB64

View File

@ -14,6 +14,7 @@ import { fileURLToPath, URL } from 'node:url'
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
base: './',
plugins: [ plugins: [
VueRouter(), VueRouter(),
Layouts(), Layouts(),
@ -39,7 +40,7 @@ export default defineConfig({
runtimeCaching: [ runtimeCaching: [
{ {
urlPattern: ({ url, sameOrigin }) => { urlPattern: ({ url, sameOrigin }) => {
return sameOrigin && url.pathname.startsWith('/assets/'); return sameOrigin && url.pathname.endsWith('/assets/');
}, },
handler: 'CacheFirst', handler: 'CacheFirst',
options: { options: {
@ -103,28 +104,28 @@ export default defineConfig({
theme_color: '#212121', theme_color: '#212121',
background_color: '#212121', background_color: '#212121',
display: 'standalone', display: 'standalone',
start_url: '/', start_url: './',
edge_side_panel: { edge_side_panel: {
default_path: '/', default_path: './',
}, },
icons: [ icons: [
{ {
src: '/pwa/image/pwa-64x64.png', src: './pwa/image/pwa-64x64.png',
sizes: '64x64', sizes: '64x64',
type: 'image/png' type: 'image/png'
}, },
{ {
src: '/pwa/image/pwa-192x192.png', src: './pwa/image/pwa-192x192.png',
sizes: '192x192', sizes: '192x192',
type: 'image/png' type: 'image/png'
}, },
{ {
src: '/pwa/image/pwa-512x512.png', src: './pwa/image/pwa-512x512.png',
sizes: '512x512', sizes: '512x512',
type: 'image/png' type: 'image/png'
}, },
{ {
src: '/pwa/image/maskable-icon-512x512.png', src: './pwa/image/maskable-icon-512x512.png',
sizes: '512x512', sizes: '512x512',
type: 'image/png', type: 'image/png',
purpose: 'maskable' purpose: 'maskable'
@ -134,10 +135,10 @@ export default defineConfig({
{ {
name: '随机点名', name: '随机点名',
short_name: '随机点名', short_name: '随机点名',
url: '/#random-picker', url: './#random-picker',
icons: [ icons: [
{ {
src: '/pwa/image/pwa-64x64.png', src: './pwa/image/pwa-64x64.png',
sizes: '64x64', sizes: '64x64',
type: 'image/png' type: 'image/png'
} }