|
|
|
@ -544,48 +544,48 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 自定义上传 |
|
|
|
|
handleRequest (data) { |
|
|
|
|
console.log(33, Util.isVideo(this.fileType)) |
|
|
|
|
// 视频上传另外调阿里云的接口处理 |
|
|
|
|
if (Util.isVideo(this.fileType)) { |
|
|
|
|
// console.log(33, Util.isVideo(this.fileType)) |
|
|
|
|
// // 视频上传另外调阿里云的接口处理 |
|
|
|
|
// if (Util.isVideo(this.fileType)) { |
|
|
|
|
|
|
|
|
|
console.log("🚀 ~ file: contentSettings.vue:587 ~ handleRequest ~ AliyunUpload:", AliyunUpload) |
|
|
|
|
var uploader = new AliyunUpload.Vod({ |
|
|
|
|
// userID,必填,您可以使用阿里云账号访问账号中心(https://account.console.aliyun.com/),即可查看账号ID |
|
|
|
|
userId: "1686385620732064", |
|
|
|
|
// 分片大小默认1 MB,不能小于100 KB(100*1024) |
|
|
|
|
partSize: 1048576, |
|
|
|
|
// 并行上传分片个数,默认5 |
|
|
|
|
parallel: 5, |
|
|
|
|
// 网络原因失败时,重新上传次数,默认为3 |
|
|
|
|
retryCount: 3, |
|
|
|
|
// 网络原因失败时,重新上传间隔时间,默认为2秒 |
|
|
|
|
retryDuration: 2, |
|
|
|
|
// 开始上传 |
|
|
|
|
'onUploadstarted': function (uploadInfo) { |
|
|
|
|
console.log("🚀 ~ file: contentSettings.vue:567 ~ handleRequest ~ uploadInfo:", uploadInfo) |
|
|
|
|
debugger |
|
|
|
|
}, |
|
|
|
|
// 文件上传成功 |
|
|
|
|
'onUploadSucceed': function (uploadInfo) { |
|
|
|
|
console.log("🚀 ~ file: contentSettings.vue:571 ~ handleRequest ~ uploadInfo:", uploadInfo) |
|
|
|
|
}, |
|
|
|
|
// 文件上传失败 |
|
|
|
|
'onUploadFailed': function (uploadInfo, code, message) { |
|
|
|
|
console.log("🚀 ~ file: contentSettings.vue:576 ~ handleRequest ~ uploadInfo, code, message:", uploadInfo, code, message) |
|
|
|
|
}, |
|
|
|
|
// 文件上传进度,单位:字节 |
|
|
|
|
'onUploadProgress': function (uploadInfo, totalSize, loadedPercent) { |
|
|
|
|
console.log("🚀 ~ file: contentSettings.vue:578 ~ handleRequest ~ uploadInfo, totalSize, loadedPercent:", uploadInfo, totalSize, loadedPercent) |
|
|
|
|
}, |
|
|
|
|
// 上传凭证或STS token超时 |
|
|
|
|
'onUploadTokenExpired': function (uploadInfo) { |
|
|
|
|
}, |
|
|
|
|
// 全部文件上传结束 |
|
|
|
|
'onUploadEnd': function (uploadInfo) { |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
// console.log("🚀 ~ file: contentSettings.vue:587 ~ handleRequest ~ AliyunUpload:", AliyunUpload) |
|
|
|
|
// var uploader = new AliyunUpload.Vod({ |
|
|
|
|
// // userID,必填,您可以使用阿里云账号访问账号中心(https://account.console.aliyun.com/),即可查看账号ID |
|
|
|
|
// userId: "1686385620732064", |
|
|
|
|
// // 分片大小默认1 MB,不能小于100 KB(100*1024) |
|
|
|
|
// partSize: 1048576, |
|
|
|
|
// // 并行上传分片个数,默认5 |
|
|
|
|
// parallel: 5, |
|
|
|
|
// // 网络原因失败时,重新上传次数,默认为3 |
|
|
|
|
// retryCount: 3, |
|
|
|
|
// // 网络原因失败时,重新上传间隔时间,默认为2秒 |
|
|
|
|
// retryDuration: 2, |
|
|
|
|
// // 开始上传 |
|
|
|
|
// 'onUploadstarted': function (uploadInfo) { |
|
|
|
|
// console.log("🚀 ~ file: contentSettings.vue:567 ~ handleRequest ~ uploadInfo:", uploadInfo) |
|
|
|
|
// debugger |
|
|
|
|
// }, |
|
|
|
|
// // 文件上传成功 |
|
|
|
|
// 'onUploadSucceed': function (uploadInfo) { |
|
|
|
|
// console.log("🚀 ~ file: contentSettings.vue:571 ~ handleRequest ~ uploadInfo:", uploadInfo) |
|
|
|
|
// }, |
|
|
|
|
// // 文件上传失败 |
|
|
|
|
// 'onUploadFailed': function (uploadInfo, code, message) { |
|
|
|
|
// console.log("🚀 ~ file: contentSettings.vue:576 ~ handleRequest ~ uploadInfo, code, message:", uploadInfo, code, message) |
|
|
|
|
// }, |
|
|
|
|
// // 文件上传进度,单位:字节 |
|
|
|
|
// 'onUploadProgress': function (uploadInfo, totalSize, loadedPercent) { |
|
|
|
|
// console.log("🚀 ~ file: contentSettings.vue:578 ~ handleRequest ~ uploadInfo, totalSize, loadedPercent:", uploadInfo, totalSize, loadedPercent) |
|
|
|
|
// }, |
|
|
|
|
// // 上传凭证或STS token超时 |
|
|
|
|
// 'onUploadTokenExpired': function (uploadInfo) { |
|
|
|
|
// }, |
|
|
|
|
// // 全部文件上传结束 |
|
|
|
|
// 'onUploadEnd': function (uploadInfo) { |
|
|
|
|
// } |
|
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
// } else { |
|
|
|
|
const param = new FormData() |
|
|
|
|
param.append('file', data.file) |
|
|
|
|
const config = { |
|
|
|
@ -611,7 +611,7 @@ export default { |
|
|
|
|
this.fileUrl = fileUrl |
|
|
|
|
this.fileName = ossFileName |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
// } |
|
|
|
|
}, |
|
|
|
|
uploadError (err, file, fileList) { |
|
|
|
|
this.$message({ |
|
|
|
|