mirror of https://github.com/layui/layui
修改 upload 的 `dataType` 属性值默认为 `json`
parent
3b919e1b7a
commit
359c6a19f1
|
@ -256,6 +256,7 @@ layui.define(['lay','layer'], function(exports){
|
|||
url: options.url,
|
||||
type: 'post', // 统一采用 post 上传
|
||||
data: formData,
|
||||
dataType: options.dataType || 'json',
|
||||
contentType: false,
|
||||
processData: false,
|
||||
headers: options.headers || {},
|
||||
|
@ -274,12 +275,7 @@ layui.define(['lay','layer'], function(exports){
|
|||
allDone();
|
||||
}
|
||||
};
|
||||
// dataType
|
||||
if (options.dataType) {
|
||||
opts.dataType = options.dataType;
|
||||
} else if (options.force === 'json') {
|
||||
opts.dataType = options.force;
|
||||
}
|
||||
|
||||
// 进度条
|
||||
if(typeof options.progress === 'function'){
|
||||
opts.xhr = function(){
|
||||
|
|
Loading…
Reference in New Issue