Added: display default picbed

This commit is contained in:
Molunerfinn 2018-04-06 22:18:57 +08:00
parent eecf98e452
commit 422aa52763
2 changed files with 37 additions and 2 deletions

24
src/datastore/pic-bed.js Normal file
View File

@ -0,0 +1,24 @@
const picBed = [
{
title: '微博图床',
value: 'weibo'
},
{
title: '七牛云',
value: 'qiniu'
},
{
title: '腾讯COS',
value: 'tcyun'
},
{
title: '又拍云',
value: 'upyun'
},
{
title: 'GitHub图床',
value: 'github'
}
]
export default picBed

View File

@ -3,7 +3,7 @@
<el-row :gutter="16"> <el-row :gutter="16">
<el-col :span="20" :offset="2"> <el-col :span="20" :offset="2">
<div class="view-title"> <div class="view-title">
图片上传 图片上传 - {{ picBed }}
</div> </div>
<div <div
id="upload-area" id="upload-area"
@ -54,6 +54,7 @@
</template> </template>
<script> <script>
import mixin from '../mixin' import mixin from '../mixin'
import picBed from '../../../datastore/pic-bed'
export default { export default {
name: 'upload', name: 'upload',
mixins: [mixin], mixins: [mixin],
@ -63,7 +64,8 @@ export default {
progress: 0, progress: 0,
showProgress: false, showProgress: false,
showError: false, showError: false,
pasteStyle: '' pasteStyle: '',
picBed: ''
} }
}, },
mounted () { mounted () {
@ -77,6 +79,7 @@ export default {
} }
}) })
this.getPasteStyle() this.getPasteStyle()
this.getDefaultPicBed()
}, },
watch: { watch: {
progress (val) { progress (val) {
@ -126,6 +129,14 @@ export default {
}, },
uploadClipboardFiles () { uploadClipboardFiles () {
this.$electron.ipcRenderer.send('uploadClipboardFilesFromUploadPage') this.$electron.ipcRenderer.send('uploadClipboardFilesFromUploadPage')
},
getDefaultPicBed () {
const current = this.$db.read().get('picBed.current').value()
picBed.forEach(item => {
if (item.value === current) {
this.picBed = item.title
}
})
} }
} }
} }