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)

View File

@@ -40,6 +40,11 @@
>
<el-input v-model="form.path" @keyup.native.enter="confirm" placeholder="例如img/"></el-input>
</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-button-group>
<el-button type="primary" @click="confirm" round>确定</el-button>
@@ -62,6 +67,7 @@ export default {
repo: '',
token: '',
path: '',
customUrl: '',
branch: ''
}
}