Skip to content

Commit 3bde262

Browse files
committed
fix post mock get 请求参数失败问题
1 parent 3fc0751 commit 3bde262

File tree

9 files changed

+27
-113
lines changed

9 files changed

+27
-113
lines changed

dist/iclient-classic.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1826,7 +1826,10 @@ var FetchRequest = exports.FetchRequest = _SuperMap2.default.FetchRequest = {
18261826
},
18271827
_postSimulatie: function _postSimulatie(type, url, params, options) {
18281828
var separator = url.indexOf("?") > -1 ? "&" : "?";
1829-
url += separator + '_method= ' + type;
1829+
url += separator + '_method=' + type;
1830+
if (typeof params !== 'string') {
1831+
params = JSON.stringify(params);
1832+
}
18301833
return this.post(url, params, options);
18311834
},
18321835

dist/iclient-classic.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/iclient9-leaflet.js

Lines changed: 5 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -6171,7 +6171,10 @@ var FetchRequest = exports.FetchRequest = _SuperMap2["default"].FetchRequest = {
61716171
},
61726172
_postSimulatie: function _postSimulatie(type, url, params, options) {
61736173
var separator = url.indexOf("?") > -1 ? "&" : "?";
6174-
url += separator + '_method= ' + type;
6174+
url += separator + '_method=' + type;
6175+
if (typeof params !== 'string') {
6176+
params = JSON.stringify(params);
6177+
}
61756178
return this.post(url, params, options);
61766179
},
61776180

@@ -91899,108 +91902,7 @@ exports.names = ["Van_der_Grinten_I", "VanDerGrinten", "vandg"];
9189991902
/* 465 */
9190091903
/***/ (function(module, exports) {
9190191904

91902-
module.exports = {
91903-
"_from": "proj4@2.3.15",
91904-
"_id": "proj4@2.3.15",
91905-
"_inBundle": false,
91906-
"_integrity": "sha1-WtBui8owvg/6OJpJ5FZfUfBtCJ4=",
91907-
"_location": "/proj4",
91908-
"_phantomChildren": {},
91909-
"_requested": {
91910-
"type": "version",
91911-
"registry": true,
91912-
"raw": "proj4@2.3.15",
91913-
"name": "proj4",
91914-
"escapedName": "proj4",
91915-
"rawSpec": "2.3.15",
91916-
"saveSpec": null,
91917-
"fetchSpec": "2.3.15"
91918-
},
91919-
"_requiredBy": [
91920-
"/"
91921-
],
91922-
"_resolved": "https://registry.npmjs.org/proj4/-/proj4-2.3.15.tgz",
91923-
"_shasum": "5ad06e8bca30be0ffa389a49e4565f51f06d089e",
91924-
"_spec": "proj4@2.3.15",
91925-
"_where": "G:\\github-iClient\\iClient9",
91926-
"author": "",
91927-
"bugs": {
91928-
"url": "https://github.com/proj4js/proj4js/issues"
91929-
},
91930-
"bundleDependencies": false,
91931-
"contributors": [
91932-
{
91933-
"name": "Mike Adair",
91934-
"email": "madair@dmsolutions.ca"
91935-
},
91936-
{
91937-
"name": "Richard Greenwood",
91938-
"email": "rich@greenwoodmap.com"
91939-
},
91940-
{
91941-
"name": "Calvin Metcalf",
91942-
"email": "calvin.metcalf@gmail.com"
91943-
},
91944-
{
91945-
"name": "Richard Marsden",
91946-
"url": "http://www.winwaed.com"
91947-
},
91948-
{
91949-
"name": "T. Mittan"
91950-
},
91951-
{
91952-
"name": "D. Steinwand"
91953-
},
91954-
{
91955-
"name": "S. Nelson"
91956-
}
91957-
],
91958-
"dependencies": {
91959-
"mgrs": "~0.0.2"
91960-
},
91961-
"deprecated": false,
91962-
"description": "Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.",
91963-
"devDependencies": {
91964-
"browserify": "~12.0.1",
91965-
"chai": "~1.8.1",
91966-
"curl": "git://github.com/cujojs/curl.git",
91967-
"grunt": "~0.4.2",
91968-
"grunt-browserify": "~4.0.1",
91969-
"grunt-cli": "~0.1.13",
91970-
"grunt-contrib-connect": "~0.6.0",
91971-
"grunt-contrib-jshint": "~0.8.0",
91972-
"grunt-contrib-uglify": "~0.11.1",
91973-
"grunt-mocha-phantomjs": "~0.4.0",
91974-
"istanbul": "~0.2.4",
91975-
"mocha": "~1.17.1",
91976-
"tin": "~0.4.0"
91977-
},
91978-
"directories": {
91979-
"test": "test",
91980-
"doc": "docs"
91981-
},
91982-
"homepage": "https://github.com/proj4js/proj4js#readme",
91983-
"jam": {
91984-
"main": "dist/proj4.js",
91985-
"include": [
91986-
"dist/proj4.js",
91987-
"README.md",
91988-
"AUTHORS",
91989-
"LICENSE.md"
91990-
]
91991-
},
91992-
"license": "MIT",
91993-
"main": "lib/index.js",
91994-
"name": "proj4",
91995-
"repository": {
91996-
"type": "git",
91997-
"url": "git://github.com/proj4js/proj4js.git"
91998-
},
91999-
"scripts": {
92000-
"test": "./node_modules/istanbul/lib/cli.js test ./node_modules/mocha/bin/_mocha test/test.js"
92001-
},
92002-
"version": "2.3.15"
92003-
};
91905+
module.exports = {"_args":[[{"raw":"proj4@2.3.15","scope":null,"escapedName":"proj4","name":"proj4","rawSpec":"2.3.15","spec":"2.3.15","type":"version"},"E:\\git\\iClient9"]],"_from":"proj4@2.3.15","_id":"proj4@2.3.15","_inCache":true,"_location":"/proj4","_nodeVersion":"6.1.0","_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/proj4-2.3.15.tgz_1471808262546_0.6752060337457806"},"_npmUser":{"name":"ahocevar","email":"andreas.hocevar@gmail.com"},"_npmVersion":"3.8.6","_phantomChildren":{},"_requested":{"raw":"proj4@2.3.15","scope":null,"escapedName":"proj4","name":"proj4","rawSpec":"2.3.15","spec":"2.3.15","type":"version"},"_requiredBy":["/"],"_resolved":"https://registry.npmjs.org/proj4/-/proj4-2.3.15.tgz","_shasum":"5ad06e8bca30be0ffa389a49e4565f51f06d089e","_shrinkwrap":null,"_spec":"proj4@2.3.15","_where":"E:\\git\\iClient9","author":"","bugs":{"url":"https://github.com/proj4js/proj4js/issues"},"contributors":[{"name":"Mike Adair","email":"madair@dmsolutions.ca"},{"name":"Richard Greenwood","email":"rich@greenwoodmap.com"},{"name":"Calvin Metcalf","email":"calvin.metcalf@gmail.com"},{"name":"Richard Marsden","url":"http://www.winwaed.com"},{"name":"T. Mittan"},{"name":"D. Steinwand"},{"name":"S. Nelson"}],"dependencies":{"mgrs":"~0.0.2"},"description":"Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.","devDependencies":{"browserify":"~12.0.1","chai":"~1.8.1","curl":"git://github.com/cujojs/curl.git","grunt":"~0.4.2","grunt-browserify":"~4.0.1","grunt-cli":"~0.1.13","grunt-contrib-connect":"~0.6.0","grunt-contrib-jshint":"~0.8.0","grunt-contrib-uglify":"~0.11.1","grunt-mocha-phantomjs":"~0.4.0","istanbul":"~0.2.4","mocha":"~1.17.1","tin":"~0.4.0"},"directories":{"test":"test","doc":"docs"},"dist":{"shasum":"5ad06e8bca30be0ffa389a49e4565f51f06d089e","tarball":"https://registry.npmjs.org/proj4/-/proj4-2.3.15.tgz"},"gitHead":"9fa5249c1f4183d5ddee3c4793dfd7b9f29f1886","homepage":"https://github.com/proj4js/proj4js#readme","jam":{"main":"dist/proj4.js","include":["dist/proj4.js","README.md","AUTHORS","LICENSE.md"]},"license":"MIT","main":"lib/index.js","maintainers":[{"name":"cwmma","email":"calvin.metcalf@gmail.com"},{"name":"ahocevar","email":"andreas.hocevar@gmail.com"}],"name":"proj4","optionalDependencies":{},"readme":"ERROR: No README data found!","repository":{"type":"git","url":"git://github.com/proj4js/proj4js.git"},"scripts":{"test":"./node_modules/istanbul/lib/cli.js test ./node_modules/mocha/bin/_mocha test/test.js"},"version":"2.3.15"}
9200491906

9200591907
/***/ }),
9200691908
/* 466 */

dist/iclient9-leaflet.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/iclient9-mapboxgl.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12098,7 +12098,10 @@ var FetchRequest = exports.FetchRequest = _SuperMap2.default.FetchRequest = {
1209812098
},
1209912099
_postSimulatie: function _postSimulatie(type, url, params, options) {
1210012100
var separator = url.indexOf("?") > -1 ? "&" : "?";
12101-
url += separator + '_method= ' + type;
12101+
url += separator + '_method=' + type;
12102+
if (typeof params !== 'string') {
12103+
params = JSON.stringify(params);
12104+
}
1210212105
return this.post(url, params, options);
1210312106
},
1210412107

dist/iclient9-mapboxgl.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/iclient9-openlayers.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6413,7 +6413,10 @@ var FetchRequest = exports.FetchRequest = _SuperMap2.default.FetchRequest = {
64136413
},
64146414
_postSimulatie: function _postSimulatie(type, url, params, options) {
64156415
var separator = url.indexOf("?") > -1 ? "&" : "?";
6416-
url += separator + '_method= ' + type;
6416+
url += separator + '_method=' + type;
6417+
if (typeof params !== 'string') {
6418+
params = JSON.stringify(params);
6419+
}
64176420
return this.post(url, params, options);
64186421
},
64196422

dist/iclient9-openlayers.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/common/util/FetchRequest.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import fetchJsonp from 'fetch-jsonp';
44
import SuperMap from '../SuperMap';
55

66
export var Support = SuperMap.Support = SuperMap.Support || {
7-
cors: (window.XMLHttpRequest && 'withCredentials' in new window.XMLHttpRequest())
8-
};
7+
cors: (window.XMLHttpRequest && 'withCredentials' in new window.XMLHttpRequest())
8+
};
99
export var FetchRequest = SuperMap.FetchRequest = {
1010
commit: function (method, url, params, options) {
1111
method = method ? method.toUpperCase() : method;
@@ -79,7 +79,10 @@ export var FetchRequest = SuperMap.FetchRequest = {
7979
},
8080
_postSimulatie: function (type, url, params, options) {
8181
var separator = url.indexOf("?") > -1 ? "&" : "?";
82-
url += separator + '_method= ' + type;
82+
url += separator + '_method=' + type;
83+
if (typeof params !== 'string') {
84+
params = JSON.stringify(params);
85+
}
8386
return this.post(url, params, options);
8487
},
8588

0 commit comments

Comments
 (0)