Skip to content

Commit 2ba61fd

Browse files
committed
【fix】service的options.withCredentials默认为空,同域携带凭证
1 parent 1f5bf4d commit 2ba61fd

File tree

131 files changed

+144
-129
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+144
-129
lines changed

src/common/iPortal/iPortal.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ import { IPortalShareParam } from "./iPortalShareParam";
1818
* @extends {IPortalServiceBase}
1919
* @param {string} iportalUrl - 服务地址。
2020
* @param {Object} options - 可选参数。
21-
* @param {boolean} [options.withCredentials] - 请求是否携带 cookie
21+
* @param {boolean} [options.withCredentials] - 请求是否携带凭据。默认情况下,仅同源请求包含凭据
2222
* @usage
2323
*/
2424
export class IPortal extends IPortalServiceBase {
2525
constructor(iportalUrl, options) {
2626
super(iportalUrl, options);
2727
this.iportalUrl = iportalUrl;
2828
options = options || {};
29-
this.withCredentials = options.withCredentials || false;
29+
this.withCredentials = options.withCredentials;
3030
}
3131

3232
/**

src/common/iPortal/iPortalServiceBase.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { FetchRequest } from '../util/FetchRequest';
1212
* @category iPortal/Online Core
1313
* @param {string} url - 服务地址。
1414
* @param {Object} options - 可选参数。
15-
* @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie
15+
* @param {boolean} [options.withCredentials] - 请求是否携带凭据。默认情况下,仅同源请求包含凭据
1616
* @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
1717
* @param {Object} [options.headers] - 请求头。
1818
* @usage

src/common/iServer/ChartService.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* @param {string} url - 服务地址。
2525
* @param {Object} options - 参数。
2626
* @param {string} [options.proxy] - 服务代理地址。
27-
* @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie
27+
* @param {boolean} [options.withCredentials] - 请求是否携带凭据。默认情况下,仅同源请求包含凭据
2828
* @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
2929
* @param {Object} [options.headers] - 请求头。
3030
* @param {function} [options.fieldNameFormatter] - 对查询返回结果的字段名进行自定义。

src/common/iServer/CommonServiceBase.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { FunctionExt } from '../commontypes/BaseTypes';
1717
* @param {string} url - 服务地址。
1818
* @param {Object} options - 参数。
1919
* @param {string} [options.proxy] - 服务代理地址。
20-
* @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie
20+
* @param {boolean} [options.withCredentials] - 请求是否携带凭据。默认情况下,仅同源请求包含凭据
2121
* @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
2222
* @param {Object} [options.headers] - 请求头。
2323
* @usage
@@ -48,7 +48,7 @@ export class CommonServiceBase {
4848

4949
this.isInTheSameDomain = null;
5050

51-
this.withCredentials = false;
51+
this.withCredentials = null;
5252

5353
if (Util.isArray(url)) {
5454
me.urls = url;
@@ -121,7 +121,7 @@ export class CommonServiceBase {
121121
* @param {function} options.failure - 请求失败后的回调函数。
122122
* @param {Object} [options.scope] - 如果回调函数是对象的一个公共方法,设定该对象的范围。
123123
* @param {boolean} [options.isInTheSameDomain] - 请求是否在当前域中。
124-
* @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie
124+
* @param {boolean} [options.withCredentials] - 请求是否携带凭据。默认情况下,仅同源请求包含凭据
125125
* @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
126126
* @param {Object} [options.headers] - 请求头。
127127
*/

src/common/iServer/FeatureService.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const FEATURE_SERVICE_MAP = {
3131
* @param {string} url - 服务地址。
3232
* @param {Object} options - 参数。
3333
* @param {string} [options.proxy] - 服务代理地址。
34-
* @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie
34+
* @param {boolean} [options.withCredentials] - 请求是否携带凭据。默认情况下,仅同源请求包含凭据
3535
* @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
3636
* @param {Object} [options.headers] - 请求头。
3737
* @param {boolean} [options.preferServer=false] - 当resultFormat=DataFormat.GEOJSON时,使用服务器直接返回geojson。

src/common/iServer/FieldService.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { FieldStatisticsParameters } from './FieldStatisticsParameters';
1616
* @param {string} url - 服务地址。
1717
* @param {Object} options - 参数。
1818
* @param {string} [options.proxy] - 服务代理地址。
19-
* @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie
19+
* @param {boolean} [options.withCredentials] - 请求是否携带凭据。默认情况下,仅同源请求包含凭据
2020
* @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
2121
* @param {Object} [options.headers] - 请求头。
2222
* @extends {ServiceBase}

src/common/iServer/InitMapServiceBase.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { scaleToResolution, getZoomByResolution } from '../util/MapCalculateUtil
1515
* @param {MapService} MapService - 地图信息服务类。
1616
* @param {Object} options - 参数。
1717
* @param {string} [options.proxy] - 服务代理地址。
18-
* @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie
18+
* @param {boolean} [options.withCredentials] - 请求是否携带凭据。默认情况下,仅同源请求包含凭据
1919
* @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
2020
* @param {Object} [options.headers] - 请求头。
2121
* @usage

src/common/iServer/KnowledgeGraphService.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { CommonServiceBase } from './CommonServiceBase';
1515
* @param {string} url - 服务地址。
1616
* @param {Object} options - 可选参数。
1717
* @param {string} [options.proxy] - 服务代理地址。
18-
* @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie
18+
* @param {boolean} [options.withCredentials] - 请求是否携带凭据。默认情况下,仅同源请求包含凭据
1919
* @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
2020
* @param {Object} [options.headers] - 请求头。
2121
* @usage

src/common/iServer/NetworkAnalyst3DService.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
2222
* @param {Object} options - 参数。
2323
* @param {string} [options.proxy] - 服务代理地址。
24-
* @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie
24+
* @param {boolean} [options.withCredentials] - 请求是否携带凭据。默认情况下,仅同源请求包含凭据
2525
* @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
2626
* @param {Object} [options.headers] - 请求头。
2727
* @usage

src/common/iServer/NetworkAnalystService.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import { UpdateTurnNodeWeightService } from './UpdateTurnNodeWeightService';
3232
* 例如: "http://localhost:8090/iserver/services/test/rest/networkanalyst/WaterNet@FacilityNet"。
3333
* @param {Object} options - 参数。
3434
* @param {string} [options.proxy] - 服务代理地址。
35-
* @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie
35+
* @param {boolean} [options.withCredentials] - 请求是否携带凭据。默认情况下,仅同源请求包含凭据
3636
* @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
3737
* @param {Object} [options.headers] - 请求头。
3838
* @usage

0 commit comments

Comments
 (0)