Merge pull request #194 from bale836/master

Support post+json for table module
This commit is contained in:
贤心 2018-04-03 02:33:57 +08:00 committed by GitHub
commit ea0c76e4fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -411,11 +411,18 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
var params = {};
params[request.pageName] = curr;
params[request.limitName] = options.limit;
var tmpdata = "";
if(options.contenttype.indexOf("application/json") == 0){
tmpdata = JSON.stringify($.extend(params, options.where));
} else {
tmpdata = $.extend(params, options.where);
}
$.ajax({
type: options.method || 'get'
,url: options.url
,data: $.extend(params, options.where)
,contentType: options.contenttype
,data: tmpdata
,dataType: 'json'
,success: function(res){
if(res[response.statusName] != response.statusCode){