mirror of
https://github.com/Kuingsmile/PicList.git
synced 2025-01-23 06:38:13 -05:00
Added: tcyun cos custom url
This commit is contained in:
parent
25068a8949
commit
e1c151e310
@ -52,13 +52,20 @@ const tcYunUpload = async (img, type, webContents) => {
|
|||||||
webContents.send('uploadProgress', 30)
|
webContents.send('uploadProgress', 30)
|
||||||
const singature = generateSignature()
|
const singature = generateSignature()
|
||||||
const length = imgList.length
|
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) {
|
for (let i in imgList) {
|
||||||
const options = postOptions(imgList[i].fileName, singature, imgList[i].base64Image)
|
const options = postOptions(imgList[i].fileName, singature, imgList[i].base64Image)
|
||||||
const res = await request(options)
|
const res = await request(options)
|
||||||
const body = JSON.parse(res)
|
const body = JSON.parse(res)
|
||||||
if (body.message === 'SUCCESS') {
|
if (body.message === 'SUCCESS') {
|
||||||
delete imgList[i].base64Image
|
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'
|
imgList[i]['type'] = 'tcyun'
|
||||||
if (i - length === -1) {
|
if (i - length === -1) {
|
||||||
webContents.send('uploadProgress', 60)
|
webContents.send('uploadProgress', 60)
|
||||||
|
@ -24,4 +24,12 @@
|
|||||||
width 100%
|
width 100%
|
||||||
.el-button
|
.el-button
|
||||||
width 50%
|
width 50%
|
||||||
|
*::-webkit-scrollbar
|
||||||
|
width 8px
|
||||||
|
height 8px
|
||||||
|
*::-webkit-scrollbar-thumb
|
||||||
|
border-radius 4px
|
||||||
|
background #6f6f6f
|
||||||
|
*::-webkit-scrollbar-track
|
||||||
|
background-color transparent
|
||||||
</style>
|
</style>
|
||||||
|
@ -111,14 +111,6 @@ export default {
|
|||||||
padding 8px 0
|
padding 8px 0
|
||||||
overflow-y auto
|
overflow-y auto
|
||||||
overflow-x hidden
|
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
|
.el-col
|
||||||
height 150px
|
height 150px
|
||||||
position relative
|
position relative
|
||||||
|
@ -56,6 +56,11 @@
|
|||||||
>
|
>
|
||||||
<el-input v-model="form.path" @keyup.native.enter="confirm" placeholder="例如img/"></el-input>
|
<el-input v-model="form.path" @keyup.native.enter="confirm" placeholder="例如img/"></el-input>
|
||||||
</el-form-item>
|
</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-form-item>
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button type="primary" @click="confirm" round>确定</el-button>
|
<el-button type="primary" @click="confirm" round>确定</el-button>
|
||||||
@ -80,7 +85,8 @@ export default {
|
|||||||
bucket: '',
|
bucket: '',
|
||||||
appId: '',
|
appId: '',
|
||||||
area: '',
|
area: '',
|
||||||
path: ''
|
path: '',
|
||||||
|
customUrl: ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -125,6 +131,8 @@ export default {
|
|||||||
color #eee
|
color #eee
|
||||||
.el-input__inner
|
.el-input__inner
|
||||||
border-radius 19px
|
border-radius 19px
|
||||||
|
&-item
|
||||||
|
margin-bottom 10.5px
|
||||||
.el-radio-group
|
.el-radio-group
|
||||||
width 100%
|
width 100%
|
||||||
label
|
label
|
||||||
|
Loading…
Reference in New Issue
Block a user