@@ -3059,7 +3059,7 @@ SuperMap.Request = {
30593059
30603060 get: function (url, params, options) {
30613061 var type = 'GET';
3062- url = this._appendUrlTokenParameter (url);
3062+ url = this._processUrl (url);
30633063 url = SuperMap.Util.urlAppend(url, this._getParameterString(params || {}));
30643064 if (url.length <= 2000) {
30653065 if (SuperMap.Support.cors) {
@@ -3075,7 +3075,7 @@ SuperMap.Request = {
30753075
30763076 delete: function (url, params, options) {
30773077 var type = 'DELETE';
3078- url = this._appendUrlTokenParameter (url);
3078+ url = this._processUrl (url);
30793079 url = SuperMap.Util.urlAppend(url, this._getParameterString(params || {}));
30803080 if (url.length <= 2000 && SuperMap.Support.cors) {
30813081 return this._fetch(url, params, options, type);
@@ -3084,11 +3084,11 @@ SuperMap.Request = {
30843084 },
30853085
30863086 post: function (url, params, options) {
3087- return this._fetch(this._appendUrlTokenParameter (url), params, options, 'POST');
3087+ return this._fetch(this._processUrl (url), params, options, 'POST');
30883088 },
30893089
30903090 put: function (url, params, options) {
3091- return this._fetch(this._appendUrlTokenParameter (url), params, options, 'PUT');
3091+ return this._fetch(this._processUrl (url), params, options, 'PUT');
30923092 },
30933093
30943094 _postSimulatie: function (type, url, params, options) {
@@ -3097,11 +3097,16 @@ SuperMap.Request = {
30973097 return this.post(url, params, options);
30983098 },
30993099
3100- _appendUrlTokenParameter: function (url) {
3101- url = (url.indexOf('.json') === -1 && url.indexOf("?") === -1) ? (url + '.json') : url;
3102- if (SuperMap.Credential.CREDENTIAL && SuperMap.Credential.CREDENTIAL.getUrlParameters()) {
3103- var separator = url.indexOf("?") > -1 ? "&" : "?";
3104- url += separator + SuperMap.Credential.CREDENTIAL.getUrlParameters();
3100+ _processUrl: function (url) {
3101+ if (url.indexOf('.json') === -1) {
3102+ if (url.indexOf("?") < 0) {
3103+ url += '.json'
3104+ } else {
3105+ var urlArrays = url.split("?");
3106+ if (urlArrays.length === 2) {
3107+ url = urlArrays[0] + ".json?" + urlArrays[1]
3108+ }
3109+ }
31053110 }
31063111 return url;
31073112 },
@@ -12183,18 +12188,12 @@ var iPortalService = __webpack_require__(189);
1218312188var iPortalMap = __webpack_require__(187);
1218412189SuperMap.iPortal = SuperMap.Class(SuperMap.iPortalServiceBase, {
1218512190
12186- initialize: function (iportalUrl, token ) {
12191+ initialize: function (iportalUrl) {
1218712192 this.iportalUrl = iportalUrl;
12188- this.token = token;
1218912193 },
1219012194
1219112195 load: function () {
12192- var me = this;
12193- return SuperMap.Request.get(me.iportalUrl + '/web').then(function (result) {
12194- if (result) {
12195- SuperMap.Credential.CREDENTIAL = new SuperMap.Credential(me.token, 'token');
12196- }
12197- });
12196+ return SuperMap.Request.get(this.iportalUrl + '/web');
1219812197 },
1219912198
1220012199 queryServices: function (queryParams) {
@@ -12219,7 +12218,7 @@ SuperMap.iPortal = SuperMap.Class(SuperMap.iPortalServiceBase, {
1221912218 var mapRetult = {};
1222012219 var maps = [];
1222112220 result.content.map(function (mapJsonObj) {
12222- maps.push(new iPortalMap(mapsUrl+ "/"+ mapJsonObj.id, mapJsonObj));
12221+ maps.push(new iPortalMap(mapsUrl + "/" + mapJsonObj.id, mapJsonObj));
1222312222 });
1222412223 mapRetult.content = maps;
1222512224 mapRetult.currentPage = result.currentPage;
@@ -12228,8 +12227,7 @@ SuperMap.iPortal = SuperMap.Class(SuperMap.iPortalServiceBase, {
1222812227 mapRetult.totalPage = result.totalPage;
1222912228 return mapRetult;
1223012229 });
12231- },
12232-
12230+ }
1223312231});
1223412232
1223512233module.exports = SuperMap.iPortal;
0 commit comments