From f8eceae8e48f89c1bb968bb4bb149d88ecf436d4 Mon Sep 17 00:00:00 2001 From: Molunerfinn Date: Sat, 26 May 2018 10:34:04 +0800 Subject: [PATCH] Finished: github custom url --- README.md | 2 ++ src/main/utils/githubUpload.js | 6 +++++- src/renderer/components/SettingView/GitHub.vue | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2ac8317..15aa3d9 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,8 @@ PicGo目前支持了`微博图床`,`七牛图床`,`腾讯云COS v4\v5版本` 如果第一次使用,请参考应用使用[手册](https://github.com/Molunerfinn/PicGo/wiki)。 +开发进度可以查看[Projects](https://github.com/Molunerfinn/PicGo/projects),会同步更新开发进度。 + ![](https://user-images.githubusercontent.com/12621342/34242857-d177930a-e658-11e7-9688-7405851dd5e5.gif) ![picgo-menubar](https://user-images.githubusercontent.com/12621342/34242310-b5056510-e655-11e7-8568-60ffd4f71910.gif) diff --git a/src/main/utils/githubUpload.js b/src/main/utils/githubUpload.js index 46f0046..1bfaf73 100644 --- a/src/main/utils/githubUpload.js +++ b/src/main/utils/githubUpload.js @@ -36,7 +36,11 @@ const githubUpload = async function (img, type, webContents) { const body = await request(postConfig) if (body) { delete imgList[i].base64Image - imgList[i]['imgUrl'] = body.content.download_url + if (githubOptions.customUrl) { + imgList[i]['imgUrl'] = `${githubOptions.customUrl}/${githubOptions.path}${imgList[i].fileName}` + } else { + imgList[i]['imgUrl'] = body.content.download_url + } imgList[i]['type'] = 'github' if (i - length === -1) { webContents.send('uploadProgress', 60) diff --git a/src/renderer/components/SettingView/GitHub.vue b/src/renderer/components/SettingView/GitHub.vue index 07b8454..f847e62 100644 --- a/src/renderer/components/SettingView/GitHub.vue +++ b/src/renderer/components/SettingView/GitHub.vue @@ -40,6 +40,11 @@ > + + + 确定 @@ -62,6 +67,7 @@ export default { repo: '', token: '', path: '', + customUrl: '', branch: '' } }