Skip to content

Commit 08aebda

Browse files
committed
【fix】修复在10.0.1 iportal中对url数组编码异常的问题 review by liqian 、huangqinghua
1 parent dcca0cc commit 08aebda

25 files changed

Lines changed: 1850 additions & 2197 deletions

‎dist/classic/iclient-classic-es6.js‎

Lines changed: 7 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2389,17 +2389,8 @@ SuperMap.Util.getParameterString = function (params) {
23892389
var value = params[key];
23902390
if ((value != null) && (typeof value !== 'function')) {
23912391
var encodedValue;
2392-
if (typeof value === 'object' && value.constructor === Array) {
2393-
/* value is an array; encode items and separate with "," */
2394-
var encodedItemArray = [];
2395-
var item;
2396-
for (var itemIndex = 0, len = value.length; itemIndex < len; itemIndex++) {
2397-
item = value[itemIndex];
2398-
encodedItemArray.push(encodeURIComponent(
2399-
(item === null || item === undefined) ? "" : item)
2400-
);
2401-
}
2402-
encodedValue = encodedItemArray.join(",");
2392+
if (Array.isArray(value) || value.toString() === '[object Object]') {
2393+
encodedValue = encodeURIComponent(JSON.stringify(value));
24032394
} else {
24042395
/* value is a string; simply encode */
24052396
encodedValue = encodeURIComponent(value);
@@ -4953,15 +4944,8 @@ var FetchRequest = SuperMap.FetchRequest = {
49534944
var value = params[key];
49544945
if ((value != null) && (typeof value !== 'function')) {
49554946
var encodedValue;
4956-
if (typeof value === 'object' && value.constructor === Array) {
4957-
var encodedItemArray = [];
4958-
var item;
4959-
for (var itemIndex = 0, len = value.length; itemIndex < len; itemIndex++) {
4960-
item = value[itemIndex];
4961-
encodedItemArray.push(encodeURIComponent(
4962-
(item === null || item === undefined) ? "" : item));
4963-
}
4964-
encodedValue = '[' + encodedItemArray.join(",") + ']';
4947+
if (Array.isArray(value) || value.toString() === '[object Object]') {
4948+
encodedValue = encodeURIComponent(JSON.stringify(value));
49654949
} else {
49664950
encodedValue = encodeURIComponent(value);
49674951
}
@@ -8314,19 +8298,9 @@ SuperMap.TopologyValidatorJobsParameter = TopologyValidatorJobsParameter_Topolog
83148298
* @param {number} [options.maxReturn] - 最大返回结果数。
83158299
*/
83168300
class GeoCodingParameter_GeoCodingParameter {
8317-
8318-
8319-
8320-
83218301
constructor(options) {
8322-
if (options.filters) {
8323-
let strs = [];
8324-
let fields = options.filters.split(',');
8325-
fields.map(function (field) {
8326-
strs.push("\"" + field + "\"");
8327-
return field;
8328-
});
8329-
options.filters = strs;
8302+
if (options.filters && typeof(options.filters) === 'string') {
8303+
options.filters = options.filters.split(',');
83308304
}
83318305
/**
83328306
* @member {string} SuperMap.GeoCodingParameter.prototype.address
@@ -8408,13 +8382,7 @@ class GeoDecodingParameter_GeoDecodingParameter {
84088382
constructor(options) {
84098383

84108384
if (options.filters) {
8411-
let strs = [];
8412-
let fields = options.filters.split(',');
8413-
fields.map(function (field) {
8414-
strs.push("\"" + field + "\"");
8415-
return field
8416-
});
8417-
options.filters = strs;
8385+
options.filters = options.filters.split(',');
84188386
}
84198387
/**
84208388
* @member {number} SuperMap.GeoDecodingParameter.prototype.x

‎dist/classic/iclient-classic-es6.min.js‎

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/classic/iclient-classic.js‎

Lines changed: 7 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2533,17 +2533,8 @@ SuperMap.Util.getParameterString = function (params) {
25332533
if (value != null && typeof value !== 'function') {
25342534
var encodedValue;
25352535

2536-
if (_typeof(value) === 'object' && value.constructor === Array) {
2537-
/* value is an array; encode items and separate with "," */
2538-
var encodedItemArray = [];
2539-
var item;
2540-
2541-
for (var itemIndex = 0, len = value.length; itemIndex < len; itemIndex++) {
2542-
item = value[itemIndex];
2543-
encodedItemArray.push(encodeURIComponent(item === null || item === undefined ? "" : item));
2544-
}
2545-
2546-
encodedValue = encodedItemArray.join(",");
2536+
if (Array.isArray(value) || value.toString() === '[object Object]') {
2537+
encodedValue = encodeURIComponent(JSON.stringify(value));
25472538
} else {
25482539
/* value is a string; simply encode */
25492540
encodedValue = encodeURIComponent(value);
@@ -5102,8 +5093,6 @@ var fetch_jsonp = __webpack_require__(2);
51025093
var fetch_jsonp_default = /*#__PURE__*/__webpack_require__.n(fetch_jsonp);
51035094

51045095
// CONCATENATED MODULE: ./src/common/util/FetchRequest.js
5105-
function FetchRequest_typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FetchRequest_typeof = function _typeof(obj) { return typeof obj; }; } else { FetchRequest_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FetchRequest_typeof(obj); }
5106-
51075096
/* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
51085097
* This program are made available under the terms of the Apache License, Version 2.0
51095098
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
@@ -5372,16 +5361,8 @@ var FetchRequest = SuperMap.FetchRequest = {
53725361
if (value != null && typeof value !== 'function') {
53735362
var encodedValue;
53745363

5375-
if (FetchRequest_typeof(value) === 'object' && value.constructor === Array) {
5376-
var encodedItemArray = [];
5377-
var item;
5378-
5379-
for (var itemIndex = 0, len = value.length; itemIndex < len; itemIndex++) {
5380-
item = value[itemIndex];
5381-
encodedItemArray.push(encodeURIComponent(item === null || item === undefined ? "" : item));
5382-
}
5383-
5384-
encodedValue = '[' + encodedItemArray.join(",") + ']';
5364+
if (Array.isArray(value) || value.toString() === '[object Object]') {
5365+
encodedValue = encodeURIComponent(JSON.stringify(value));
53855366
} else {
53865367
encodedValue = encodeURIComponent(value);
53875368
}
@@ -9301,14 +9282,8 @@ function () {
93019282
function GeoCodingParameter(options) {
93029283
GeoCodingParameter_classCallCheck(this, GeoCodingParameter);
93039284

9304-
if (options.filters) {
9305-
var strs = [];
9306-
var fields = options.filters.split(',');
9307-
fields.map(function (field) {
9308-
strs.push("\"" + field + "\"");
9309-
return field;
9310-
});
9311-
options.filters = strs;
9285+
if (options.filters && typeof options.filters === 'string') {
9286+
options.filters = options.filters.split(',');
93129287
}
93139288
/**
93149289
* @member {string} SuperMap.GeoCodingParameter.prototype.address
@@ -9403,13 +9378,7 @@ function () {
94039378
GeoDecodingParameter_classCallCheck(this, GeoDecodingParameter);
94049379

94059380
if (options.filters) {
9406-
var strs = [];
9407-
var fields = options.filters.split(',');
9408-
fields.map(function (field) {
9409-
strs.push("\"" + field + "\"");
9410-
return field;
9411-
});
9412-
options.filters = strs;
9381+
options.filters = options.filters.split(',');
94139382
}
94149383
/**
94159384
* @member {number} SuperMap.GeoDecodingParameter.prototype.x

‎dist/classic/iclient-classic.min.js‎

Lines changed: 39 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/leaflet/iclient-leaflet-es6.js‎

Lines changed: 7 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6298,17 +6298,8 @@ SuperMap.Util.getParameterString = function (params) {
62986298
var value = params[key];
62996299
if ((value != null) && (typeof value !== 'function')) {
63006300
var encodedValue;
6301-
if (typeof value === 'object' && value.constructor === Array) {
6302-
/* value is an array; encode items and separate with "," */
6303-
var encodedItemArray = [];
6304-
var item;
6305-
for (var itemIndex = 0, len = value.length; itemIndex < len; itemIndex++) {
6306-
item = value[itemIndex];
6307-
encodedItemArray.push(encodeURIComponent(
6308-
(item === null || item === undefined) ? "" : item)
6309-
);
6310-
}
6311-
encodedValue = encodedItemArray.join(",");
6301+
if (Array.isArray(value) || value.toString() === '[object Object]') {
6302+
encodedValue = encodeURIComponent(JSON.stringify(value));
63126303
} else {
63136304
/* value is a string; simply encode */
63146305
encodedValue = encodeURIComponent(value);
@@ -14850,15 +14841,8 @@ var FetchRequest = SuperMap.FetchRequest = {
1485014841
var value = params[key];
1485114842
if ((value != null) && (typeof value !== 'function')) {
1485214843
var encodedValue;
14853-
if (typeof value === 'object' && value.constructor === Array) {
14854-
var encodedItemArray = [];
14855-
var item;
14856-
for (var itemIndex = 0, len = value.length; itemIndex < len; itemIndex++) {
14857-
item = value[itemIndex];
14858-
encodedItemArray.push(encodeURIComponent(
14859-
(item === null || item === undefined) ? "" : item));
14860-
}
14861-
encodedValue = '[' + encodedItemArray.join(",") + ']';
14844+
if (Array.isArray(value) || value.toString() === '[object Object]') {
14845+
encodedValue = encodeURIComponent(JSON.stringify(value));
1486214846
} else {
1486314847
encodedValue = encodeURIComponent(value);
1486414848
}
@@ -16558,19 +16542,9 @@ SuperMap.CommonServiceBase = CommonServiceBase_CommonServiceBase;
1655816542
* @param {number} [options.maxReturn] - 最大返回结果数。
1655916543
*/
1656016544
class GeoCodingParameter_GeoCodingParameter {
16561-
16562-
16563-
16564-
1656516545
constructor(options) {
16566-
if (options.filters) {
16567-
let strs = [];
16568-
let fields = options.filters.split(',');
16569-
fields.map(function (field) {
16570-
strs.push("\"" + field + "\"");
16571-
return field;
16572-
});
16573-
options.filters = strs;
16546+
if (options.filters && typeof(options.filters) === 'string') {
16547+
options.filters = options.filters.split(',');
1657416548
}
1657516549
/**
1657616550
* @member {string} SuperMap.GeoCodingParameter.prototype.address
@@ -16652,13 +16626,7 @@ class GeoDecodingParameter_GeoDecodingParameter {
1665216626
constructor(options) {
1665316627

1665416628
if (options.filters) {
16655-
let strs = [];
16656-
let fields = options.filters.split(',');
16657-
fields.map(function (field) {
16658-
strs.push("\"" + field + "\"");
16659-
return field
16660-
});
16661-
options.filters = strs;
16629+
options.filters = options.filters.split(',');
1666216630
}
1666316631
/**
1666416632
* @member {number} SuperMap.GeoDecodingParameter.prototype.x

0 commit comments

Comments
 (0)