Add attachment uploads api

pull/25/head
johnniang 2019-05-30 23:07:40 +08:00
parent a63e556b8a
commit 9333a6942c
1 changed files with 12 additions and 0 deletions

View File

@ -56,6 +56,17 @@ attachmentApi.upload = (formData, uploadProgress, cancelToken) => {
})
}
attachmentApi.uploads = (formDatas, uploadProgress, cancelToken) => {
return service({
url: `${baseUrl}/uploads`,
timeout: 8640000, // 24 hours
data: formDatas, // form data
onUploadProgress: uploadProgress,
cancelToken: cancelToken,
method: 'post'
})
}
attachmentApi.type = {
LOCAL: {
type: 'local',
@ -78,4 +89,5 @@ attachmentApi.type = {
text: '阿里云'
}
}
export default attachmentApi