Browse Source

测试图片缓存效果,极少量图片会在没有缓存成功的情况下进入水印处理

Michael Wang 3 years ago
parent
commit
66f764bd76
2 changed files with 4 additions and 0 deletions
  1. 2 0
      src/background.ts
  2. 2 0
      src/features/ImageDownload/ImageDownload.vue

+ 2 - 0
src/background.ts

@@ -41,6 +41,8 @@ async function createWindow() {
   if (config.openDevTools === true) {
     win.webContents.openDevTools();
   }
+  // 测试图片缓存效果
+  // win.webContents.session.clearCache(() => console.log("clear cache"));
 }
 
 // Quit when all windows are closed.

+ 2 - 0
src/features/ImageDownload/ImageDownload.vue

@@ -63,6 +63,7 @@ async function cacheImages(urls: string) {
           "Cache-Control": "no-cache",
         },
       })
+      .then(() => console.debug("downloaded ", url))
       .catch((e) => {
         console.log(e, "cache error");
       })
@@ -138,6 +139,7 @@ onMounted(async () => {
                 continue;
               }
 
+              console.debug("start ", sheetUrl);
               const imageRes = await httpApp.get(sheetUrl, {
                 responseType: "blob",
                 headers: {