feat: 调整get方法 data 参数自动转query

This commit is contained in:
coding 2018-03-18 12:06:27 +00:00
parent 755d4b005d
commit 320cc0479e

View File

@ -123,10 +123,11 @@ var http = {
}; };
['GET', 'DELETE', 'HEAD', 'OPTIONS'].forEach(function (method) { ['GET', 'DELETE', 'HEAD', 'OPTIONS'].forEach(function (method) {
http[method.toLowerCase()] = function __likeGet__(url, config) { http[method.toLowerCase()] = function __likeGet__(url, data, config) {
return this.request(Object.assign(config || {}, { return this.request(Object.assign(config || {}, {
url: url, url: url,
method: method method: method,
query: data
})); }));
} }
}); });