Skip to content

Commit

Permalink
Release 1.14.23
Browse files Browse the repository at this point in the history
  • Loading branch information
shengyonggen committed Sep 28, 2021
1 parent 5e9f9f9 commit 8ba6b57
Show file tree
Hide file tree
Showing 14 changed files with 73 additions and 45 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 1.14.23(2021-09-28)
1. 修复
- 修复 `setWebviewUrl` 方法可能会导致客户 `url` 中参数丢失的问题
- 修复参数 `launched` 暴露修改方法可能会导致 `$MPLaunch` 无法采集的问题
- 修复浏览插件页面退出小程序采集 `$MPHide` 事件时,控制台会捕获到异常的问题

## 1.14.22(2021-09-15)
1. 优化
- 修改初始化配置参数 `show_log` 默认值为 `fasle`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sa-sdk-miniprogram",
"version": "1.14.22",
"version": "1.14.23",
"description": "sensorsdata miniprogram sdk",
"main": "sensorsdata.min.js",
"scripts": {
Expand Down
11 changes: 6 additions & 5 deletions product/sensorsdata.custom.es6.full.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ sa.para = {
server_url: '',
send_timeout: 1000,
show_log: false,
launched: false,
allow_amend_share_path: true,
max_string_length: 500,
datasend_timeout: 3000,
Expand Down Expand Up @@ -159,7 +158,7 @@ var ArrayProto = Array.prototype,
slice = ArrayProto.slice,
toString = ObjProto.toString,
hasOwnProperty = ObjProto.hasOwnProperty,
LIB_VERSION = '1.14.22',
LIB_VERSION = '1.14.23',
LIB_NAME = 'MiniProgram';

var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term';
Expand Down Expand Up @@ -700,7 +699,7 @@ _.getCurrentPath = function() {
var url = '未取到';
try {
var currentPage = _.getCurrentPage();
url = currentPage.route;
url = currentPage ? currentPage.route : url;
} catch (e) {
logger.info(e);
}
Expand Down Expand Up @@ -1857,7 +1856,7 @@ sa.getLocation = function() {
});
},
fail: function(err) {
console.log('获取位置失败', err);
logger.info('获取位置失败', err);
}
});
} else {
Expand Down Expand Up @@ -2186,6 +2185,7 @@ sa.setWebViewUrl = function(url, after_hash) {
search = arr[2] || '',
hash = arr[3] || '',
nurl = '';

var distinct_id = sa.store.getDistinctId() || '',
first_id = sa.store.getFirstId() || '',
idIndex;
Expand Down Expand Up @@ -2215,7 +2215,8 @@ sa.setWebViewUrl = function(url, after_hash) {
var hasQuery = /^\?(\w)+/.test(search);
if (hasQuery) {
if (idIndex > -1) {
nurl = host + '?' + search.substring(1, idIndex) + '_sasdk=' + value + hash;
var newSearch = search.replace(/(_sasdk=)([^&]*)/gi, '_sasdk=' + value);
nurl = host + newSearch + hash;
} else {
nurl = host + '?' + search.substring(1) + '&_sasdk=' + value + hash;
}
Expand Down
11 changes: 6 additions & 5 deletions product/sensorsdata.custom.full.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ sa.para = {
server_url: '',
send_timeout: 1000,
show_log: false,
launched: false,
allow_amend_share_path: true,
max_string_length: 500,
datasend_timeout: 3000,
Expand Down Expand Up @@ -161,7 +160,7 @@ var ArrayProto = Array.prototype,
slice = ArrayProto.slice,
toString = ObjProto.toString,
hasOwnProperty = ObjProto.hasOwnProperty,
LIB_VERSION = '1.14.22',
LIB_VERSION = '1.14.23',
LIB_NAME = 'MiniProgram';

var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term';
Expand Down Expand Up @@ -702,7 +701,7 @@ _.getCurrentPath = function() {
var url = '未取到';
try {
var currentPage = _.getCurrentPage();
url = currentPage.route;
url = currentPage ? currentPage.route : url;
} catch (e) {
logger.info(e);
}
Expand Down Expand Up @@ -1859,7 +1858,7 @@ sa.getLocation = function() {
});
},
fail: function(err) {
console.log('获取位置失败', err);
logger.info('获取位置失败', err);
}
});
} else {
Expand Down Expand Up @@ -2188,6 +2187,7 @@ sa.setWebViewUrl = function(url, after_hash) {
search = arr[2] || '',
hash = arr[3] || '',
nurl = '';

var distinct_id = sa.store.getDistinctId() || '',
first_id = sa.store.getFirstId() || '',
idIndex;
Expand Down Expand Up @@ -2217,7 +2217,8 @@ sa.setWebViewUrl = function(url, after_hash) {
var hasQuery = /^\?(\w)+/.test(search);
if (hasQuery) {
if (idIndex > -1) {
nurl = host + '?' + search.substring(1, idIndex) + '_sasdk=' + value + hash;
var newSearch = search.replace(/(_sasdk=)([^&]*)/gi, '_sasdk=' + value);
nurl = host + newSearch + hash;
} else {
nurl = host + '?' + search.substring(1) + '&_sasdk=' + value + hash;
}
Expand Down
19 changes: 12 additions & 7 deletions product/sensorsdata.es6.full.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ sa.para = {
server_url: '',
send_timeout: 1000,
show_log: false,
launched: false,
allow_amend_share_path: true,
max_string_length: 500,
datasend_timeout: 3000,
Expand Down Expand Up @@ -43,6 +42,10 @@ sa.para = {
storage_prepare_data_key: 'sensors_mp_prepare_data'
};

var deploy_para = {
launched: false
};

var mpHook = {
data: 1,
onLoad: 1,
Expand Down Expand Up @@ -159,7 +162,7 @@ var ArrayProto = Array.prototype,
slice = ArrayProto.slice,
toString = ObjProto.toString,
hasOwnProperty = ObjProto.hasOwnProperty,
LIB_VERSION = '1.14.22',
LIB_VERSION = '1.14.23',
LIB_NAME = 'MiniProgram';

var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term';
Expand Down Expand Up @@ -700,7 +703,7 @@ _.getCurrentPath = function() {
var url = '未取到';
try {
var currentPage = _.getCurrentPage();
url = currentPage.route;
url = currentPage ? currentPage.route : url;
} catch (e) {
logger.info(e);
}
Expand Down Expand Up @@ -1857,7 +1860,7 @@ sa.getLocation = function() {
});
},
fail: function(err) {
console.log('获取位置失败', err);
logger.info('获取位置失败', err);
}
});
} else {
Expand Down Expand Up @@ -2186,6 +2189,7 @@ sa.setWebViewUrl = function(url, after_hash) {
search = arr[2] || '',
hash = arr[3] || '',
nurl = '';

var distinct_id = sa.store.getDistinctId() || '',
first_id = sa.store.getFirstId() || '',
idIndex;
Expand Down Expand Up @@ -2215,7 +2219,8 @@ sa.setWebViewUrl = function(url, after_hash) {
var hasQuery = /^\?(\w)+/.test(search);
if (hasQuery) {
if (idIndex > -1) {
nurl = host + '?' + search.substring(1, idIndex) + '_sasdk=' + value + hash;
var newSearch = search.replace(/(_sasdk=)([^&]*)/gi, '_sasdk=' + value);
nurl = host + newSearch + hash;
} else {
nurl = host + '?' + search.substring(1) + '&_sasdk=' + value + hash;
}
Expand Down Expand Up @@ -2830,10 +2835,10 @@ sa.pageShow = function(prop) {
};

wx.onAppShow(function(para) {
if (!sa.para.launched) {
if (!deploy_para.launched) {
var option = wx.getLaunchOptionsSync() || {};
sa.autoTrackCustom.appLaunch(option);
sa.para.launched = true;
deploy_para.launched = true;
}
sa.autoTrackCustom.appShow(para);
});
Expand Down
19 changes: 12 additions & 7 deletions product/sensorsdata.full.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ sa.para = {
server_url: '',
send_timeout: 1000,
show_log: false,
launched: false,
allow_amend_share_path: true,
max_string_length: 500,
datasend_timeout: 3000,
Expand Down Expand Up @@ -45,6 +44,10 @@ sa.para = {
storage_prepare_data_key: 'sensors_mp_prepare_data'
};

var deploy_para = {
launched: false
};

var mpHook = {
data: 1,
onLoad: 1,
Expand Down Expand Up @@ -161,7 +164,7 @@ var ArrayProto = Array.prototype,
slice = ArrayProto.slice,
toString = ObjProto.toString,
hasOwnProperty = ObjProto.hasOwnProperty,
LIB_VERSION = '1.14.22',
LIB_VERSION = '1.14.23',
LIB_NAME = 'MiniProgram';

var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term';
Expand Down Expand Up @@ -702,7 +705,7 @@ _.getCurrentPath = function() {
var url = '未取到';
try {
var currentPage = _.getCurrentPage();
url = currentPage.route;
url = currentPage ? currentPage.route : url;
} catch (e) {
logger.info(e);
}
Expand Down Expand Up @@ -1859,7 +1862,7 @@ sa.getLocation = function() {
});
},
fail: function(err) {
console.log('获取位置失败', err);
logger.info('获取位置失败', err);
}
});
} else {
Expand Down Expand Up @@ -2188,6 +2191,7 @@ sa.setWebViewUrl = function(url, after_hash) {
search = arr[2] || '',
hash = arr[3] || '',
nurl = '';

var distinct_id = sa.store.getDistinctId() || '',
first_id = sa.store.getFirstId() || '',
idIndex;
Expand Down Expand Up @@ -2217,7 +2221,8 @@ sa.setWebViewUrl = function(url, after_hash) {
var hasQuery = /^\?(\w)+/.test(search);
if (hasQuery) {
if (idIndex > -1) {
nurl = host + '?' + search.substring(1, idIndex) + '_sasdk=' + value + hash;
var newSearch = search.replace(/(_sasdk=)([^&]*)/gi, '_sasdk=' + value);
nurl = host + newSearch + hash;
} else {
nurl = host + '?' + search.substring(1) + '&_sasdk=' + value + hash;
}
Expand Down Expand Up @@ -2832,10 +2837,10 @@ sa.pageShow = function(prop) {
};

wx.onAppShow(function(para) {
if (!sa.para.launched) {
if (!deploy_para.launched) {
var option = wx.getLaunchOptionsSync() || {};
sa.autoTrackCustom.appLaunch(option);
sa.para.launched = true;
deploy_para.launched = true;
}
sa.autoTrackCustom.appShow(para);
});
Expand Down
19 changes: 12 additions & 7 deletions product/sensorsdata.plugin.es6.full.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ sa.para = {
server_url: '',
send_timeout: 1000,
show_log: false,
launched: false,
allow_amend_share_path: true,
max_string_length: 500,
datasend_timeout: 3000,
Expand Down Expand Up @@ -43,6 +42,10 @@ sa.para = {
storage_prepare_data_key: 'sensors_mp_prepare_data'
};

var deploy_para = {
launched: false
};

var mpHook = {
data: 1,
onLoad: 1,
Expand Down Expand Up @@ -159,7 +162,7 @@ var ArrayProto = Array.prototype,
slice = ArrayProto.slice,
toString = ObjProto.toString,
hasOwnProperty = ObjProto.hasOwnProperty,
LIB_VERSION = '1.14.22',
LIB_VERSION = '1.14.23',
LIB_NAME = 'MiniProgram';

var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term';
Expand Down Expand Up @@ -700,7 +703,7 @@ _.getCurrentPath = function() {
var url = '未取到';
try {
var currentPage = _.getCurrentPage();
url = currentPage.route;
url = currentPage ? currentPage.route : url;
} catch (e) {
logger.info(e);
}
Expand Down Expand Up @@ -1857,7 +1860,7 @@ sa.getLocation = function() {
});
},
fail: function(err) {
console.log('获取位置失败', err);
logger.info('获取位置失败', err);
}
});
} else {
Expand Down Expand Up @@ -2186,6 +2189,7 @@ sa.setWebViewUrl = function(url, after_hash) {
search = arr[2] || '',
hash = arr[3] || '',
nurl = '';

var distinct_id = sa.store.getDistinctId() || '',
first_id = sa.store.getFirstId() || '',
idIndex;
Expand Down Expand Up @@ -2215,7 +2219,8 @@ sa.setWebViewUrl = function(url, after_hash) {
var hasQuery = /^\?(\w)+/.test(search);
if (hasQuery) {
if (idIndex > -1) {
nurl = host + '?' + search.substring(1, idIndex) + '_sasdk=' + value + hash;
var newSearch = search.replace(/(_sasdk=)([^&]*)/gi, '_sasdk=' + value);
nurl = host + newSearch + hash;
} else {
nurl = host + '?' + search.substring(1) + '&_sasdk=' + value + hash;
}
Expand Down Expand Up @@ -2830,10 +2835,10 @@ sa.pageShow = function(prop) {
};

wx.onAppShow(function(para) {
if (!sa.para.launched) {
if (!deploy_para.launched) {
var option = wx.getLaunchOptionsSync() || {};
sa.autoTrackCustom.appLaunch(option);
sa.para.launched = true;
deploy_para.launched = true;
}
sa.autoTrackCustom.appShow(para);
});
Expand Down
Loading

0 comments on commit 8ba6b57

Please sign in to comment.