修改视频上传的错误
This commit is contained in:
parent
b4bee074d1
commit
43c4f22a45
@ -207,7 +207,13 @@ export default {
|
||||
if (pos !== -1) {
|
||||
suffix = file.substring(pos)
|
||||
}
|
||||
const filename = new Date().getTime() + suffix
|
||||
let filename = new Date().getTime() + suffix
|
||||
let month = new Date().getMonth() + 1
|
||||
if (month < 10) {
|
||||
month = '0' + month
|
||||
}
|
||||
const path = new Date().getFullYear() + '' + month + new Date().getDate()
|
||||
filename = 'def/' + path + '/' + filename
|
||||
const formData = new FormData()
|
||||
const data = res
|
||||
// 注意formData里append添加的键的大小写
|
||||
@ -219,14 +225,13 @@ export default {
|
||||
formData.append('file', fileObject)
|
||||
formData.append('success_action_status', 200) // 成功后返回的操作码
|
||||
const url = data.host
|
||||
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 + '/def/' + filename : fileUrl })
|
||||
resolve({ url: data.cdn ? data.cdn + '/' + filename : data.host + '/' + filename })
|
||||
}).catch(res => {
|
||||
reject({ msg: res })
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user