|
|
@@ -7,13 +7,13 @@
|
|
|
</div>
|
|
|
<div class="text item">
|
|
|
<el-upload
|
|
|
- :action="actionUrl"
|
|
|
+ :action="imgOssUrl"
|
|
|
:headers="imgHeaders"
|
|
|
:data="imgData"
|
|
|
:file-list="uploadImages"
|
|
|
:multiple="true"
|
|
|
:limit="40"
|
|
|
- :with-credentials="true"
|
|
|
+ :with-credentials="false"
|
|
|
list-type="picture-card"
|
|
|
:before-upload="handleBeforeUpload"
|
|
|
:on-success="handleOnSuccess"
|
|
|
@@ -72,13 +72,13 @@ export default {
|
|
|
components: {},
|
|
|
data() {
|
|
|
return {
|
|
|
- actionUrl: process.env.VUE_APP_OSS_URL,
|
|
|
+ imgOssUrl: '',
|
|
|
// ****************************************************************************************************************
|
|
|
imgHeaders: {
|
|
|
Authorization: ''
|
|
|
},
|
|
|
imgData: {
|
|
|
- channelId: 6
|
|
|
+ channelId: process.env.VUE_APP_UPLOAD_PHOTO_CHANNEL
|
|
|
},
|
|
|
dialogImageUrl: '',
|
|
|
dialogVisible: false,
|
|
|
@@ -87,6 +87,7 @@ export default {
|
|
|
submitForm: {
|
|
|
imageFileIds: [],
|
|
|
albumName: null,
|
|
|
+ channelId: process.env.VUE_APP_UPLOAD_PHOTO_CHANNEL,
|
|
|
scope: '1',
|
|
|
scheduledPubDate: null
|
|
|
},
|
|
|
@@ -101,19 +102,20 @@ export default {
|
|
|
getServerInfo(this.imgData.channelId).then(res => {
|
|
|
if (res.code === 0) {
|
|
|
const resData = res.data
|
|
|
+ this.imgOssUrl = resData.ossUrl
|
|
|
this.imgHeaders.Authorization = 'Bearer ' + resData.token
|
|
|
} else {
|
|
|
this.$notify({
|
|
|
- title: '失败提示',
|
|
|
- message: res.msg,
|
|
|
- type: 'warning',
|
|
|
+ title: '提示',
|
|
|
+ message: '获取 OSS 服务器地址失败, 暂时无法上传图片',
|
|
|
+ type: 'error',
|
|
|
duration: 3000
|
|
|
})
|
|
|
}
|
|
|
}).catch(error => {
|
|
|
this.$notify({
|
|
|
- title: '错误提示',
|
|
|
- message: error.message,
|
|
|
+ title: '提示',
|
|
|
+ message: '获取 OSS 服务器地址失败, 暂时无法上传图片',
|
|
|
type: 'warning',
|
|
|
duration: 3000
|
|
|
})
|