|
|
|
@ -7,11 +7,11 @@ const api = { |
|
|
|
|
|
|
|
|
|
// 图片上传
|
|
|
|
|
export const image = (files, checkLogin = true) => { |
|
|
|
|
// 文件上传大小, 2M
|
|
|
|
|
const maxSize = 1024 * 1024 * 2 |
|
|
|
|
// 文件上传大小, 5M
|
|
|
|
|
const maxSize = 1024 * 1024 * 5 |
|
|
|
|
// 执行上传
|
|
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
|
request.urlFileUpload({ name: 'file', files, maxSize, data: { test: 123, checkLogin: Number(checkLogin) } }) |
|
|
|
|
request.urlFileUpload({ name: 'file', files, maxSize, data: { filename: files[0].name, test: 123, checkLogin: Number(checkLogin) } }) |
|
|
|
|
.then(result => resolve(result.map(item => item.data.fileInfo.file_id), result)) |
|
|
|
|
.catch(reject) |
|
|
|
|
}) |
|
|
|
|