Skip to content

Commit e21a421

Browse files
committed
【fix】UT ,代理地址的数据服务401问题
1 parent ec84818 commit e21a421

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/common/util/MapCalculateUtil.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@ import { Unit } from '../REST';
2222
* ```
2323
*/
2424
export var getMeterPerMapUnit = function(mapUnit) {
25-
var earchRadiusInMeters = 6378137;
2625
var meterPerMapUnit;
26+
if(!mapUnit){
27+
return meterPerMapUnit;
28+
}
29+
var earchRadiusInMeters = 6378137;
2730
if (['m','meter','meters'].indexOf(mapUnit.toLocaleLowerCase())>-1) {
2831
meterPerMapUnit = 1;
2932
} else if (['degrees','deg','degree','dd'].indexOf(mapUnit.toLocaleLowerCase())>-1) {

src/openlayers/mapping/WebMap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2145,7 +2145,7 @@ export class WebMap extends Observable {
21452145
dataSourceName = dataSource.dataSourceName || layer.name;
21462146
let requestUrl = that.formatUrlWithCredential(url), serviceOptions = {};
21472147
serviceOptions.withCredentials = this.withCredentials;
2148-
if (!this.excludePortalProxyUrl && !CommonUtil.isInTheSameDomain(requestUrl)) {
2148+
if (!this.excludePortalProxyUrl && !CommonUtil.isInTheSameDomain(requestUrl) && !this.isIportalProxyServiceUrl(requestUrl)) {
21492149
serviceOptions.proxy = this.getProxy();
21502150
}
21512151
if(['EPSG:0'].includes(layer.projection)) {

0 commit comments

Comments
 (0)