@@ -1464,15 +1464,21 @@ var CommonServiceBase = function () {
14641464 timeout: options.async ? 0 : null,
14651465 proxy: options.proxy
14661466 }).then(function (response) {
1467- return response.text();
1467+ if (response.text) {
1468+ return response.text();
1469+ }
1470+ return response.json();
14681471 }).then(function (text) {
1469- var result = new _SuperMap2.default.Format.JSON().read(text);
1470- if (!result) {
1471- result = { error: text };
1472+ var result = text;
1473+ if (typeof text === "string") {
1474+ result = new _SuperMap2.default.Format.JSON().read(text);
1475+ }
1476+ if (!result || result.error || result.code >= 300 && result.code !== 304) {
1477+ result = { error: result };
14721478 }
14731479 if (result.error) {
14741480 var failure = options.scope ? _SuperMap2.default.Function.bind(options.failure, options.scope) : options.failure;
1475- failure(result.error );
1481+ failure(result);
14761482 } else {
14771483 result.succeed = result.succeed == undefined ? true : result.succeed;
14781484 var success = options.scope ? _SuperMap2.default.Function.bind(options.success, options.scope) : options.success;
@@ -25862,8 +25868,6 @@ var TileSuperMapRest = function (_ol$source$TileImage) {
2586225868
2586325869 var layerUrl = options.url + "/tileImage.png?";
2586425870 options.serverType = options.serverType || _SuperMap2.default.ServerType.ISERVER;
25865- //为url添加安全认证信息片段
25866- layerUrl = appendCredential(layerUrl, options.serverType);
2586725871
2586825872 var _this = _possibleConstructorReturn(this, (TileSuperMapRest.__proto__ || Object.getPrototypeOf(TileSuperMapRest)).call(this, {
2586925873 attributions: options.attributions,
@@ -25891,6 +25895,7 @@ var TileSuperMapRest = function (_ol$source$TileImage) {
2589125895 //当前切片在切片集中的index
2589225896 _this.tileSetsIndex = -1;
2589325897 _this.tempIndex = -1;
25898+
2589425899 function appendCredential(url, serverType) {
2589525900 var newUrl = url,
2589625901 credential,
@@ -25992,6 +25997,8 @@ var TileSuperMapRest = function (_ol$source$TileImage) {
2599225997 */
2599325998 function createLayerUrl() {
2599425999 this._layerUrl = layerUrl + getRequestParamString.call(this);
26000+ //为url添加安全认证信息片段
26001+ this._layerUrl = appendCredential(this._layerUrl, options.serverType);
2599526002 return this._layerUrl;
2599626003 }
2599726004
@@ -40052,14 +40059,14 @@ var EditFeaturesParameters = function () {
4005240059
4005340060 features = { ids: params.IDs };
4005440061 } else {
40055- if (params.features === null) return;
40056-
40057- len = params.features.length;
4005840062 features = [];
40059- for (var i = 0; i < len; i++) {
40060- feature = params.features[i];
40061- feature.geometry = _ServerGeometry2.default.fromGeometry(feature.geometry);
40062- features.push(feature);
40063+ if (params.features) {
40064+ len = params.features.length;
40065+ for (var i = 0; i < len; i++) {
40066+ feature = params.features[i];
40067+ feature.geometry = _ServerGeometry2.default.fromGeometry(feature.geometry);
40068+ features.push(feature);
40069+ }
4006340070 }
4006440071 }
4006540072
0 commit comments