From d61b572709349a018d74ce0d7d36e9ff3046f2e8 Mon Sep 17 00:00:00 2001 From: "fish.yu" Date: Thu, 18 Apr 2024 12:29:53 +0800 Subject: [PATCH] fix: wrong url link, remove debug log --- lib/download.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/download.js b/lib/download.js index 44be4b7..0beba98 100644 --- a/lib/download.js +++ b/lib/download.js @@ -130,7 +130,7 @@ class Downloader { // } let mdBody = formatRaw(body); - console.log('md file content:', mdBody); + // console.log('md file content:', mdBody); // 判断是否有图片 const reg = /!\[(.*?)\]\((.*?)\)/g; @@ -165,12 +165,11 @@ class Downloader { const imageUrl = `_images/${imageName}`; // 上传到github const result = await this.gh.writeFile(imageUrl, content, { encode: false }); - console.log('uploadImageFromUrl result:', result); if (!result.status) { console.error('upload image failed:', url, content); throw new Error('upload image failed:', result); } - return `https://github.com/${imageUrl}`; + return result.data.content.url; } /**