mirror of https://github.com/halo-dev/halo-admin
parent
1adb0a6dcb
commit
10626d04c9
|
@ -80,19 +80,19 @@ export default {
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['options']),
|
...mapGetters(['options']),
|
||||||
maxParallelUploads() {
|
maxParallelUploads() {
|
||||||
if (this.options && this.options.length > 0) {
|
if (this.options) {
|
||||||
return this.options.attachment_upload_max_parallel_uploads
|
return this.options.attachment_upload_max_parallel_uploads
|
||||||
}
|
}
|
||||||
return 1
|
return 1
|
||||||
},
|
},
|
||||||
allowImagePreview() {
|
allowImagePreview() {
|
||||||
if (this.options && this.options.length > 0) {
|
if (this.options) {
|
||||||
return this.options.attachment_upload_image_preview_enable
|
return this.options.attachment_upload_image_preview_enable
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
},
|
},
|
||||||
maxFiles() {
|
maxFiles() {
|
||||||
if (this.options && this.options.length > 0) {
|
if (this.options) {
|
||||||
return this.options.attachment_upload_max_files
|
return this.options.attachment_upload_max_files
|
||||||
}
|
}
|
||||||
return 1
|
return 1
|
||||||
|
@ -110,7 +110,7 @@ export default {
|
||||||
|
|
||||||
this.uploadHandler(
|
this.uploadHandler(
|
||||||
formData,
|
formData,
|
||||||
progressEvent => {
|
(progressEvent) => {
|
||||||
if (progressEvent.total > 0) {
|
if (progressEvent.total > 0) {
|
||||||
progress(progressEvent.lengthComputable, progressEvent.loaded, progressEvent.total)
|
progress(progressEvent.lengthComputable, progressEvent.loaded, progressEvent.total)
|
||||||
}
|
}
|
||||||
|
@ -119,12 +119,12 @@ export default {
|
||||||
this.filed,
|
this.filed,
|
||||||
file
|
file
|
||||||
)
|
)
|
||||||
.then(response => {
|
.then((response) => {
|
||||||
load(response)
|
load(response)
|
||||||
this.$log.debug('Uploaded successfully', response)
|
this.$log.debug('Uploaded successfully', response)
|
||||||
this.$emit('success', response, file)
|
this.$emit('success', response, file)
|
||||||
})
|
})
|
||||||
.catch(failure => {
|
.catch((failure) => {
|
||||||
this.$log.debug('Failed to upload file', failure)
|
this.$log.debug('Failed to upload file', failure)
|
||||||
this.$emit('failure', failure, file)
|
this.$emit('failure', failure, file)
|
||||||
error()
|
error()
|
||||||
|
|
Loading…
Reference in New Issue