Skip to content

Commit 7d5d1de

Browse files
committed
解析主域的方式错误
1 parent f55ea19 commit 7d5d1de

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

sensorsdata.min.js

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

src/sdk.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -775,8 +775,7 @@ _.cookie = {
775775
days = typeof days === 'undefined' ? 73000 : days;
776776

777777
if (cross_subdomain) {
778-
var matches = document.location.hostname.match(/[a-z0-9][a-z0-9\-]+\.[a-z\.]{2,6}$/i)
779-
, domain = matches ? matches[0] : '';
778+
var domain = _.url('domain',location.href);
780779

781780
cdomain = ((domain) ? '; domain=.' + domain : '');
782781
}

src/sensorsdata.full.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ if(typeof JSON!=='object'){JSON={}}(function(){'use strict';var rx_one=/^[\],:{}
8080
, slice = ArrayProto.slice
8181
, toString = ObjProto.toString
8282
, hasOwnProperty = ObjProto.hasOwnProperty
83-
, LIB_VERSION = '1.7.3';
83+
, LIB_VERSION = '1.7.4';
8484

8585
sd.lib_version = LIB_VERSION;
8686

@@ -851,8 +851,7 @@ _.cookie = {
851851
days = typeof days === 'undefined' ? 73000 : days;
852852

853853
if (cross_subdomain) {
854-
var matches = document.location.hostname.match(/[a-z0-9][a-z0-9\-]+\.[a-z\.]{2,6}$/i)
855-
, domain = matches ? matches[0] : '';
854+
var domain = _.url('domain',location.href);
856855

857856
cdomain = ((domain) ? '; domain=.' + domain : '');
858857
}

version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
var sensorsdata_js_sdk_latest_version = '1.7.3';
1+
var sensorsdata_js_sdk_latest_version = '1.7.4';

vtrack.min.js

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

0 commit comments

Comments
 (0)