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