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

@ -32,6 +32,8 @@ PicGo目前支持了`微博图床``七牛图床``腾讯云COS v4\v5版本`
如果第一次使用,请参考应用使用[手册](https://github.com/Molunerfinn/PicGo/wiki)。 如果第一次使用,请参考应用使用[手册](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) ![](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) ![picgo-menubar](https://user-images.githubusercontent.com/12621342/34242310-b5056510-e655-11e7-8568-60ffd4f71910.gif)

View File

@ -36,7 +36,11 @@ const githubUpload = async function (img, type, webContents) {
const body = await request(postConfig) const body = await request(postConfig)
if (body) { if (body) {
delete imgList[i].base64Image 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' imgList[i]['type'] = 'github'
if (i - length === -1) { if (i - length === -1) {
webContents.send('uploadProgress', 60) webContents.send('uploadProgress', 60)

View File

@ -40,6 +40,11 @@
> >
<el-input v-model="form.path" @keyup.native.enter="confirm" placeholder="例如img/"></el-input> <el-input v-model="form.path" @keyup.native.enter="confirm" placeholder="例如img/"></el-input>
</el-form-item> </el-form-item>
<el-form-item
label="设定自定义域名"
>
<el-input v-model="form.customUrl" @keyup.native.enter="confirm" placeholder="例如https://xxxx.com"></el-input>
</el-form-item>
<el-form-item> <el-form-item>
<el-button-group> <el-button-group>
<el-button type="primary" @click="confirm" round>确定</el-button> <el-button type="primary" @click="confirm" round>确定</el-button>
@ -62,6 +67,7 @@ export default {
repo: '', repo: '',
token: '', token: '',
path: '', path: '',
customUrl: '',
branch: '' branch: ''
} }
} }