Browse Source

提交仅用网络

1
mo 1 year ago
parent
commit
f3f6dabb8f
2 changed files with 20 additions and 1 deletions
  1. 1 0
      src/views/login/index.tsx
  2. 19 1
      vite.config.ts

+ 1 - 0
src/views/login/index.tsx

@@ -135,6 +135,7 @@ export default defineComponent({
         </div>
         <div class={styles['view-account-form']}>
           <img class={styles.colLogo} src={colLogo}></img>
+          1111111111111
           {isForgot.value ? (
             <NTabs
               key="forgotPassword"

+ 19 - 1
vite.config.ts

@@ -62,7 +62,25 @@ export default defineConfig({
     VitePWA({
       registerType: 'autoUpdate',
       includeAssets: ['./logo.png'],
-
+      workbox: {
+        globPatterns: ['**/*.{js,css,html,ico,png,svg}'],
+        runtimeCaching: [
+          {
+            urlPattern: /(.*?)\.(js|css|ts)/, // js /css /ts静态资源缓存
+            handler: 'NetworkOnly',
+            options: {
+              cacheName: 'js-css-cache'
+            }
+          },
+          {
+            urlPattern: /(.*?)\.(png|jpe?g|svg|gif|bmp|psd|tiff|tga|eps|html)/, // 图片缓存
+            handler: 'NetworkOnly',
+            options: {
+              cacheName: 'image-cache'
+            }
+          }
+        ]
+      },
       manifest: {
         name: '酷乐秀-音乐数字课堂',
         short_name: '音乐数字课堂',