mirror of https://gitee.com/stylefeng/guns
【ajaxUtil】增加json格式化
parent
d001335855
commit
b2ca193586
|
@ -5,6 +5,9 @@ layui.define(['jquery'], function (exports) {
|
||||||
post: function (url, params, suc, err, contentType, async) {
|
post: function (url, params, suc, err, contentType, async) {
|
||||||
ajaxUtil.sendAjax(url, params, 'POST', suc, err, contentType, async);
|
ajaxUtil.sendAjax(url, params, 'POST', suc, err, contentType, async);
|
||||||
},
|
},
|
||||||
|
post: function (url, params, suc, err) {
|
||||||
|
ajaxUtil.sendAjax(url, params, 'POST', suc, err, null, null);
|
||||||
|
},
|
||||||
get: function (url, params, suc, err, contentType, async) {
|
get: function (url, params, suc, err, contentType, async) {
|
||||||
ajaxUtil.sendAjax(url, params, 'GET', suc, err, contentType, async);
|
ajaxUtil.sendAjax(url, params, 'GET', suc, err, contentType, async);
|
||||||
},
|
},
|
||||||
|
@ -19,7 +22,7 @@ layui.define(['jquery'], function (exports) {
|
||||||
url: url,
|
url: url,
|
||||||
cache: false,
|
cache: false,
|
||||||
async: async == undefined ? false : async,
|
async: async == undefined ? false : async,
|
||||||
data: params == undefined ? '' : params,
|
data: params == undefined ? '' : JSON.stringify(params),
|
||||||
type: method == undefined ? "POST" : method,
|
type: method == undefined ? "POST" : method,
|
||||||
contentType: contentType == undefined ? 'application/json; charset=UTF-8' : contentType,
|
contentType: contentType == undefined ? 'application/json; charset=UTF-8' : contentType,
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
|
|
Loading…
Reference in New Issue