diff --git a/src/main/utils/tcYunUpload.js b/src/main/utils/tcYunUpload.js index f346197..1e9267d 100644 --- a/src/main/utils/tcYunUpload.js +++ b/src/main/utils/tcYunUpload.js @@ -52,13 +52,20 @@ const tcYunUpload = async (img, type, webContents) => { webContents.send('uploadProgress', 30) const singature = generateSignature() const length = imgList.length + const tcYunOptions = db.read().get('picBed.tcyun').value() + const customUrl = tcYunOptions.customUrl + const path = tcYunOptions.path for (let i in imgList) { const options = postOptions(imgList[i].fileName, singature, imgList[i].base64Image) const res = await request(options) const body = JSON.parse(res) if (body.message === 'SUCCESS') { delete imgList[i].base64Image - imgList[i]['imgUrl'] = body.data.source_url + if (customUrl) { + imgList[i]['imgUrl'] = `${customUrl}/${path}${imgList[i].fileName}` + } else { + imgList[i]['imgUrl'] = body.data.source_url + } imgList[i]['type'] = 'tcyun' if (i - length === -1) { webContents.send('uploadProgress', 60) diff --git a/src/renderer/App.vue b/src/renderer/App.vue index 7a35a11..5945f65 100644 --- a/src/renderer/App.vue +++ b/src/renderer/App.vue @@ -24,4 +24,12 @@ width 100% .el-button width 50% + *::-webkit-scrollbar + width 8px + height 8px + *::-webkit-scrollbar-thumb + border-radius 4px + background #6f6f6f + *::-webkit-scrollbar-track + background-color transparent diff --git a/src/renderer/components/SettingView/Gallery.vue b/src/renderer/components/SettingView/Gallery.vue index 13fa313..da5b991 100644 --- a/src/renderer/components/SettingView/Gallery.vue +++ b/src/renderer/components/SettingView/Gallery.vue @@ -111,14 +111,6 @@ export default { padding 8px 0 overflow-y auto overflow-x hidden - &::-webkit-scrollbar - width 8px - height 8px - &::-webkit-scrollbar-thumb - border-radius 4px - background #6f6f6f - &::&::-webkit-scrollbar-track - background-color transparent .el-col height 150px position relative diff --git a/src/renderer/components/SettingView/TcYun.vue b/src/renderer/components/SettingView/TcYun.vue index f1f062c..77adcf7 100644 --- a/src/renderer/components/SettingView/TcYun.vue +++ b/src/renderer/components/SettingView/TcYun.vue @@ -56,6 +56,11 @@ > + + + 确定 @@ -80,7 +85,8 @@ export default { bucket: '', appId: '', area: '', - path: '' + path: '', + customUrl: '' } } }, @@ -125,6 +131,8 @@ export default { color #eee .el-input__inner border-radius 19px + &-item + margin-bottom 10.5px .el-radio-group width 100% label