Commit bb952b14 authored by 杨南鸿's avatar 杨南鸿

上传组件增加超时时间配置

parent 51f4a528
......@@ -35,6 +35,7 @@ export default function upload(option) {
const xhr = new XMLHttpRequest();
const action = option.action;
xhr.timeout = option.timeout || 120000;
if (xhr.upload) {
xhr.upload.onprogress = function progress(e) {
......
......@@ -17,6 +17,10 @@ export default {
type: String,
required: true
},
timeout: {
type: Number,
default: 120000
},
name: {
type: String,
default: 'file'
......@@ -167,6 +171,7 @@ export default {
fileindex: fileindex || '',
name: this.name,
action: this.action,
timeout: this.timeout,
onProgress: e => {
this.onProgress(e, rawFile);
},
......
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