Commit 94dcfa24 by yangzhi

fix:上传文件

parent bd4df907
...@@ -6,5 +6,5 @@ export function uploadImg(file, params = {}) { ...@@ -6,5 +6,5 @@ export function uploadImg(file, params = {}) {
for (const key in otherParams) { for (const key in otherParams) {
from.append(key, otherParams[key]) from.append(key, otherParams[key])
} }
return axios.post(url || 'platform/upload/fileUpload/images', from) return axios.post(url || 'upload/oss', from)
} }
\ No newline at end of file
...@@ -98,10 +98,13 @@ export default { ...@@ -98,10 +98,13 @@ export default {
// JS 语法 // JS 语法
// res 即服务端的返回结果 // res 即服务端的返回结果
const res = await uploadImg(files) const res = await uploadImg(files, {
url: 'upload/oss',
businessType: 'other',
})
console.log(res) console.log(res)
const { imagePath } = res const { filePath } = res
const url = _this.setimgUrl(imagePath, { const url = _this.setimgUrl(filePath, {
w: 640, w: 640,
}) })
// 从 res 中找到 url alt href ,然后插入图片 // 从 res 中找到 url alt href ,然后插入图片
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment