From 4e8dfef6cbd957bd227a7cefda529b93ad7d8ed3 Mon Sep 17 00:00:00 2001 From: Molunerfinn Date: Fri, 9 Mar 2018 23:24:48 +0800 Subject: [PATCH] Added: qiniu upload custom path --- src/main/utils/qiniuUpload.js | 3 ++- src/renderer/components/SettingView/Qiniu.vue | 10 +++++++++- src/renderer/components/SettingView/Upload.vue | 2 ++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main/utils/qiniuUpload.js b/src/main/utils/qiniuUpload.js index 5df4a36..afa4f9f 100644 --- a/src/main/utils/qiniuUpload.js +++ b/src/main/utils/qiniuUpload.js @@ -6,7 +6,8 @@ import { Notification } from 'electron' function postOptions (fileName, token, imgBase64) { const area = selectArea(db.read().get('picBed.qiniu.area').value() || 'z0') - const base64FileName = Buffer.from(fileName, 'utf-8').toString('base64').replace(/\+/g, '-').replace(/\//g, '_') + const path = db.read().get('picBed.qiniu.path') || '' + const base64FileName = Buffer.from(path + fileName, 'utf-8').toString('base64').replace(/\+/g, '-').replace(/\//g, '_') return { method: 'POST', url: `http://upload${area}.qiniu.com/putb64/-1/key/${base64FileName}`, diff --git a/src/renderer/components/SettingView/Qiniu.vue b/src/renderer/components/SettingView/Qiniu.vue index 94707b6..464be8e 100644 --- a/src/renderer/components/SettingView/Qiniu.vue +++ b/src/renderer/components/SettingView/Qiniu.vue @@ -58,6 +58,11 @@ > + + + 确定 @@ -82,7 +87,8 @@ export default { bucket: '', url: '', area: 'z0', - options: '' + options: '', + path: '' } } }, @@ -127,6 +133,8 @@ export default { color #eee .el-input__inner border-radius 19px + &-item + margin-bottom 10.5px .el-radio-group width 100% label diff --git a/src/renderer/components/SettingView/Upload.vue b/src/renderer/components/SettingView/Upload.vue index c048e8c..562491b 100644 --- a/src/renderer/components/SettingView/Upload.vue +++ b/src/renderer/components/SettingView/Upload.vue @@ -166,6 +166,8 @@ export default { margin-top 20px opacity 0 transition all .2s ease-in-out + width 450px + margin-left 25px &.show opacity 1 .el-progress-bar__inner