Skip to content

Commit 5b93087

Browse files
committed
增加了debug模式弹窗提示
1 parent a921302 commit 5b93087

File tree

4 files changed

+29
-19
lines changed

4 files changed

+29
-19
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: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,6 +1452,7 @@ saEvent.send = function(p, callback) {
14521452

14531453
// 发送debug数据请求
14541454
saEvent.debugPath = function(data, callback) {
1455+
var _data = data; //存数据
14551456
var url = '';
14561457
if (sd.para.debug_mode_url.indexOf('?') !== -1) {
14571458
url = sd.para.debug_mode_url + '&data=' + encodeURIComponent(_.base64Encode(data));
@@ -1460,14 +1461,18 @@ saEvent.send = function(p, callback) {
14601461
}
14611462

14621463
_.ajax({
1463-
url: url,
1464-
type: 'GET',
1465-
cors: true,
1466-
header: {'Dry-Run': String(sd.para.debug_mode_upload)}
1467-
});
1464+
url: url,
1465+
type: 'GET',
1466+
cors: true,
1467+
header: {'Dry-Run': String(sd.para.debug_mode_upload)},
1468+
success:function(data){
1469+
// debug 模式下 提示框
1470+
_.isEmptyObject(data) === true ? alert('debug数据发送成功' + _data) : alert('debug失败 错误原因' + JSON.stringify(data));
1471+
}
1472+
});
14681473

14691474
};
1470-
1475+
14711476
var store = sd.store = {
14721477
_sessionState: {},
14731478
_state: {},
@@ -1672,7 +1677,7 @@ saEvent.send = function(p, callback) {
16721677

16731678
props.$url = location.href;
16741679
props.$url_path = location.pathname;
1675-
props.$tite = document.title;
1680+
props.$title = document.title;
16761681

16771682
return props;
16781683
},

src/sensorsdata.full.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ if(typeof JSON!=='object'){JSON={}}(function(){'use strict';var rx_one=/^[\],:{}
620620
, slice = ArrayProto.slice
621621
, toString = ObjProto.toString
622622
, hasOwnProperty = ObjProto.hasOwnProperty
623-
, LIB_VERSION = '1.6.53';
623+
, LIB_VERSION = '1.6.54';
624624

625625
sd.lib_version = LIB_VERSION;
626626

@@ -2062,6 +2062,7 @@ saEvent.send = function(p, callback) {
20622062

20632063
// 发送debug数据请求
20642064
saEvent.debugPath = function(data, callback) {
2065+
var _data = data; //存数据
20652066
var url = '';
20662067
if (sd.para.debug_mode_url.indexOf('?') !== -1) {
20672068
url = sd.para.debug_mode_url + '&data=' + encodeURIComponent(_.base64Encode(data));
@@ -2070,14 +2071,18 @@ saEvent.send = function(p, callback) {
20702071
}
20712072

20722073
_.ajax({
2073-
url: url,
2074-
type: 'GET',
2075-
cors: true,
2076-
header: {'Dry-Run': String(sd.para.debug_mode_upload)}
2077-
});
2074+
url: url,
2075+
type: 'GET',
2076+
cors: true,
2077+
header: {'Dry-Run': String(sd.para.debug_mode_upload)},
2078+
success:function(data){
2079+
// debug 模式下 提示框
2080+
_.isEmptyObject(data) === true ? alert('debug数据发送成功' + _data) : alert('debug失败 错误原因' + JSON.stringify(data));
2081+
}
2082+
});
20782083

20792084
};
2080-
2085+
20812086
var store = sd.store = {
20822087
_sessionState: {},
20832088
_state: {},
@@ -2282,7 +2287,7 @@ saEvent.send = function(p, callback) {
22822287

22832288
props.$url = location.href;
22842289
props.$url_path = location.pathname;
2285-
props.$tite = document.title;
2290+
props.$title = document.title;
22862291

22872292
return props;
22882293
},

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)