提交 0717f6d8 authored 作者: 王鹏飞's avatar 王鹏飞

fix: 修复文件上传失败的问题

上级 580d9c01
......@@ -29,7 +29,7 @@ export default class OtherAPI extends BaseAPI {
* @param {[object]} obj
*/
uploadFile = (obj = {}) =>
this.post('/api/usercenter/user/upload-image', obj, {
this.post('/api/lms/util/upload-file', obj, {
headers: { 'Content-Type': 'multipart/form-data' }
})
......
......@@ -57,7 +57,7 @@ export default {
type: '',
lastModifiedDate: '',
size: '',
avatar: ''
file: ''
},
filesArr: []
}
......@@ -68,7 +68,7 @@ export default {
this.file.type = file.raw.type
this.file.lastModifiedDate = file.raw.lastModifiedDate
this.file.size = file.raw.size
this.file.avatar = file.raw
this.file.file = file.raw
},
uploadFile() {
if (!/\.(jpg|jpeg|gif|png|bmp)$/gi.test(this.file.name)) {
......@@ -82,7 +82,7 @@ export default {
spinner: '',
background: 'rgba(255, 255, 255, 0.9)'
})
action.Other.uploadFile({ image: this.file.avatar })
action.Other.uploadFile(this.file)
.then(data => {
this.imgUrl = data.url
this.updateUser()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论