调整富文本视频上传

This commit is contained in:
luofei 2024-04-02 15:54:35 +08:00
parent d7e0cc5d38
commit d4a60b8938

View File

@ -209,7 +209,7 @@ export default {
}
const filename = new Date().getTime() + suffix
const formData = new FormData()
const data = res.data
const data = res
// 注意formData里append添加的键的大小写
formData.append('key', filename) // 存储在oss的文件路径
formData.append('OSSAccessKeyId', data.accessid) // accessKeyId
@ -219,14 +219,14 @@ export default {
formData.append('file', fileObject)
formData.append('success_action_status', 200) // 成功后返回的操作码
const url = data.host
const fileUrl = url + '/' + filename
const fileUrl = url + '/def/' + filename
videoIng(true, 100)
return new Promise((resolve, reject) => {
axios.defaults.withCredentials = false
axios.post(url, formData).then(() => {
// that.progress = 0;
videoIng(false, 0)
resolve({ url: data.cdn ? data.cdn + '/' + filename : fileUrl })
resolve({ url: data.cdn ? data.cdn + '/def/' + filename : fileUrl })
}).catch(res => {
reject({ msg: res })
})