mirror of
https://github.com/Kuingsmile/PicList.git
synced 2025-03-15 17:28:13 -04:00
Modified: pic-bed constructure for future
This commit is contained in:
parent
a20299edaa
commit
947e49ab4a
@ -3,13 +3,15 @@ import qiniuUpload from '../main/utils/qiniuUpload'
|
|||||||
import tcYunUpload from '../main/utils/tcYunUpload'
|
import tcYunUpload from '../main/utils/tcYunUpload'
|
||||||
import upYunUpload from '../main/utils/upYunUpload'
|
import upYunUpload from '../main/utils/upYunUpload'
|
||||||
import githubUpload from '../main/utils/githubUpload'
|
import githubUpload from '../main/utils/githubUpload'
|
||||||
|
import smmsUpload from '../main/utils/smmsUpload'
|
||||||
|
|
||||||
const picBedHandler = {
|
const picBedHandler = {
|
||||||
weibo: weiboUpload,
|
weibo: weiboUpload,
|
||||||
qiniu: qiniuUpload,
|
qiniu: qiniuUpload,
|
||||||
tcyun: tcYunUpload,
|
tcyun: tcYunUpload,
|
||||||
upyun: upYunUpload,
|
upyun: upYunUpload,
|
||||||
github: githubUpload
|
github: githubUpload,
|
||||||
|
smms: smmsUpload
|
||||||
}
|
}
|
||||||
|
|
||||||
export default picBedHandler
|
export default picBedHandler
|
||||||
|
@ -1,11 +1,6 @@
|
|||||||
import weiboUpload from './weiboUpload'
|
|
||||||
import qiniuUpload from './qiniuUpload'
|
|
||||||
import tcYunUpload from './tcYunUpload'
|
|
||||||
import upYunUpload from './upYunUpload'
|
|
||||||
import githubUpload from './githubUpload'
|
|
||||||
import smmsUpload from './smmsUpload'
|
|
||||||
import db from '../../datastore/index'
|
import db from '../../datastore/index'
|
||||||
import { Notification } from 'electron'
|
import { Notification } from 'electron'
|
||||||
|
import picBeds from '../../datastore/pic-bed-handler'
|
||||||
|
|
||||||
const checkUploader = (type) => {
|
const checkUploader = (type) => {
|
||||||
const currentUploader = db.read().get(`picBed.${type}`).value()
|
const currentUploader = db.read().get(`picBed.${type}`).value()
|
||||||
@ -24,20 +19,7 @@ const uploader = (img, type, webContents) => {
|
|||||||
notification.show()
|
notification.show()
|
||||||
const uploadType = db.read().get('picBed.current').value()
|
const uploadType = db.read().get('picBed.current').value()
|
||||||
if (checkUploader(uploadType)) {
|
if (checkUploader(uploadType)) {
|
||||||
switch (uploadType) {
|
return picBeds[uploadType](img, type, webContents)
|
||||||
case 'weibo':
|
|
||||||
return weiboUpload(img, type, webContents)
|
|
||||||
case 'qiniu':
|
|
||||||
return qiniuUpload(img, type, webContents)
|
|
||||||
case 'tcyun':
|
|
||||||
return tcYunUpload(img, type, webContents)
|
|
||||||
case 'upyun':
|
|
||||||
return upYunUpload(img, type, webContents)
|
|
||||||
case 'github':
|
|
||||||
return githubUpload(img, type, webContents)
|
|
||||||
case 'smms':
|
|
||||||
return smmsUpload(img, type, webContents)
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,9 @@
|
|||||||
<div class="view-title">
|
<div class="view-title">
|
||||||
SM.MS设置
|
SM.MS设置
|
||||||
</div>
|
</div>
|
||||||
|
<div class="content">
|
||||||
|
感谢SM.MS提供的优质服务
|
||||||
|
</div>
|
||||||
<div style="text-align: center; margin-top: 20px;">
|
<div style="text-align: center; margin-top: 20px;">
|
||||||
<el-button type="success" @click="confirm" round :disabled="defaultPicBed === 'smms'" size="mini">设为默认图床</el-button>
|
<el-button type="success" @click="confirm" round :disabled="defaultPicBed === 'smms'" size="mini">设为默认图床</el-button>
|
||||||
</div>
|
</div>
|
||||||
@ -40,4 +43,9 @@ export default {
|
|||||||
font-size 20px
|
font-size 20px
|
||||||
text-align center
|
text-align center
|
||||||
margin 20px auto
|
margin 20px auto
|
||||||
|
#smms-view
|
||||||
|
.content
|
||||||
|
text-align center
|
||||||
|
font-size 14px
|
||||||
|
color #eee
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
Reference in New Issue
Block a user