Finished: github custom url

This commit is contained in:
Molunerfinn
2018-05-26 10:34:04 +08:00
parent a0c1e95b15
commit f8eceae8e4
3 changed files with 13 additions and 1 deletions

View File

@@ -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)