Skip to content

Commit

Permalink
Release 1.16.3
Browse files Browse the repository at this point in the history
  • Loading branch information
shengyonggen committed Dec 27, 2021
1 parent fe5e5a0 commit a6aa28c
Show file tree
Hide file tree
Showing 14 changed files with 107 additions and 85 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.16.3(2021-12-27)
1. 修复
- 修复 `setOpenid` 接口上报 `$BindID` 事件导致后端埋点报错的问题

## 1.16.2(2021-12-22)
1. 新增
- 支持 `ID-Mapping 3.0` 用户关联协议
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.16.2",
"version": "1.16.3",
"description": "sensorsdata miniprogram sdk",
"main": "sensorsdata.min.js",
"scripts": {
Expand Down
29 changes: 16 additions & 13 deletions product/sensorsdata.custom.es6.full.js
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ var ArrayProto = Array.prototype,
slice = ArrayProto.slice,
toString$1 = ObjProto.toString,
hasOwnProperty = ObjProto.hasOwnProperty,
LIB_VERSION = '1.16.2',
LIB_VERSION = '1.16.3',
LIB_NAME = 'MiniProgram';

var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term';
Expand Down Expand Up @@ -2475,7 +2475,10 @@ sa.setOpenid = function(openid, isCover) {
}
sa.store.set('openid', openid);
sa.identify(openid, true);
sa.bind('$identity_mp_openid', openid);

var name = _.getOpenidNameByAppid();
sa.store._state.identities[name] = openid;
sa.store.save();
};

sa.unsetOpenid = function(val) {
Expand All @@ -2488,13 +2491,18 @@ sa.unsetOpenid = function(val) {
sa.store.set('openid', '');
}

sa.unbind('$identity_mp_openid', id);
var name = _.getOpenidNameByAppid();
if (sa.store._state.identities.hasOwnProperty(name) && id === sa.store._state.identities[name]) {
delete sa.store._state.identities[name];
sa.store.save();
}
};

sa.setUnionid = function(val) {
var id = _.validId(val);
if (id) {
sa.bind('$identity_mp_unionid', id);
sa.store._state.identities['$identity_mp_unionid'] = id;
sa.store.save();
}
};

Expand All @@ -2508,8 +2516,9 @@ sa.unsetUnionid = function(val) {
delete sa.store._state.openid;
sa.store.save();
}
delete sa.store._state.identities['$identity_mp_unionid'];
sa.store.save();
}
sa.unbind('$identity_mp_unionid', id);
}
};

Expand Down Expand Up @@ -2541,7 +2550,7 @@ sa.bind = function(name, value) {
logger.info('Key must be String');
return false;
}
if (!_.check.checkKeyword(name) || name === '$identity_anonymous_id' || name === '$mp_id' || name === '$identity_mp_id' || name === '$identity_login_id' || name === sa.para.login_id_key) {
if (!_.check.checkKeyword(name) || name === '$identity_anonymous_id' || name === '$mp_id' || name === '$identity_mp_id' || name === '$mp_openid' || name === '$identity_mp_openid' || name === '$identity_mp_unionid' || name === '$mp_unionid' || name === '$identity_login_id' || name === sa.para.login_id_key) {
var info = 'Key [' + name + '] is invalid';
logger.info(info);
return false;
Expand All @@ -2560,9 +2569,6 @@ sa.bind = function(name, value) {
return false;
}
var identities = sa.store._state.identities;
if (name === '$identity_mp_openid') {
name = _.getOpenidNameByAppid();
}
identities[name] = value;
sa.store.save();

Expand All @@ -2584,7 +2590,7 @@ sa.unbind = function(name, value) {
logger.info('Key must be String');
return false;
}
if (!_.check.checkKeyword(name) || name === '$identity_anonymous_id' || name === '$mp_id' || name === '$identity_mp_id' || name === '$identity_login_id' || name === sa.para.login_id_key) {
if (!_.check.checkKeyword(name) || name === '$identity_anonymous_id' || name === '$mp_id' || name === '$identity_mp_id' || name === '$mp_openid' || name === '$identity_mp_openid' || name === '$identity_mp_unionid' || name === '$mp_unionid' || name === '$identity_login_id' || name === sa.para.login_id_key) {
var info = 'Key [' + name + '] is invalid';
logger.info(info);
return false;
Expand All @@ -2602,9 +2608,6 @@ sa.unbind = function(name, value) {
logger.info(info);
return false;
}
if (name === '$identity_mp_openid') {
name = _.getOpenidNameByAppid();
}
if (sa.store._state.identities.hasOwnProperty(name) && value === sa.store._state.identities[name]) {
delete sa.store._state.identities[name];
sa.store.save();
Expand Down
29 changes: 16 additions & 13 deletions product/sensorsdata.custom.full.js
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ var ArrayProto = Array.prototype,
slice = ArrayProto.slice,
toString$1 = ObjProto.toString,
hasOwnProperty = ObjProto.hasOwnProperty,
LIB_VERSION = '1.16.2',
LIB_VERSION = '1.16.3',
LIB_NAME = 'MiniProgram';

var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term';
Expand Down Expand Up @@ -2478,7 +2478,10 @@ sa.setOpenid = function(openid, isCover) {
}
sa.store.set('openid', openid);
sa.identify(openid, true);
sa.bind('$identity_mp_openid', openid);

var name = _.getOpenidNameByAppid();
sa.store._state.identities[name] = openid;
sa.store.save();
};

sa.unsetOpenid = function(val) {
Expand All @@ -2491,13 +2494,18 @@ sa.unsetOpenid = function(val) {
sa.store.set('openid', '');
}

sa.unbind('$identity_mp_openid', id);
var name = _.getOpenidNameByAppid();
if (sa.store._state.identities.hasOwnProperty(name) && id === sa.store._state.identities[name]) {
delete sa.store._state.identities[name];
sa.store.save();
}
};

sa.setUnionid = function(val) {
var id = _.validId(val);
if (id) {
sa.bind('$identity_mp_unionid', id);
sa.store._state.identities['$identity_mp_unionid'] = id;
sa.store.save();
}
};

Expand All @@ -2511,8 +2519,9 @@ sa.unsetUnionid = function(val) {
delete sa.store._state.openid;
sa.store.save();
}
delete sa.store._state.identities['$identity_mp_unionid'];
sa.store.save();
}
sa.unbind('$identity_mp_unionid', id);
}
};

Expand Down Expand Up @@ -2544,7 +2553,7 @@ sa.bind = function(name, value) {
logger.info('Key must be String');
return false;
}
if (!_.check.checkKeyword(name) || name === '$identity_anonymous_id' || name === '$mp_id' || name === '$identity_mp_id' || name === '$identity_login_id' || name === sa.para.login_id_key) {
if (!_.check.checkKeyword(name) || name === '$identity_anonymous_id' || name === '$mp_id' || name === '$identity_mp_id' || name === '$mp_openid' || name === '$identity_mp_openid' || name === '$identity_mp_unionid' || name === '$mp_unionid' || name === '$identity_login_id' || name === sa.para.login_id_key) {
var info = 'Key [' + name + '] is invalid';
logger.info(info);
return false;
Expand All @@ -2563,9 +2572,6 @@ sa.bind = function(name, value) {
return false;
}
var identities = sa.store._state.identities;
if (name === '$identity_mp_openid') {
name = _.getOpenidNameByAppid();
}
identities[name] = value;
sa.store.save();

Expand All @@ -2587,7 +2593,7 @@ sa.unbind = function(name, value) {
logger.info('Key must be String');
return false;
}
if (!_.check.checkKeyword(name) || name === '$identity_anonymous_id' || name === '$mp_id' || name === '$identity_mp_id' || name === '$identity_login_id' || name === sa.para.login_id_key) {
if (!_.check.checkKeyword(name) || name === '$identity_anonymous_id' || name === '$mp_id' || name === '$identity_mp_id' || name === '$mp_openid' || name === '$identity_mp_openid' || name === '$identity_mp_unionid' || name === '$mp_unionid' || name === '$identity_login_id' || name === sa.para.login_id_key) {
var info = 'Key [' + name + '] is invalid';
logger.info(info);
return false;
Expand All @@ -2605,9 +2611,6 @@ sa.unbind = function(name, value) {
logger.info(info);
return false;
}
if (name === '$identity_mp_openid') {
name = _.getOpenidNameByAppid();
}
if (sa.store._state.identities.hasOwnProperty(name) && value === sa.store._state.identities[name]) {
delete sa.store._state.identities[name];
sa.store.save();
Expand Down
29 changes: 16 additions & 13 deletions product/sensorsdata.es6.full.js
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ var ArrayProto = Array.prototype,
slice = ArrayProto.slice,
toString$1 = ObjProto.toString,
hasOwnProperty = ObjProto.hasOwnProperty,
LIB_VERSION = '1.16.2',
LIB_VERSION = '1.16.3',
LIB_NAME = 'MiniProgram';

var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term';
Expand Down Expand Up @@ -2479,7 +2479,10 @@ sa.setOpenid = function(openid, isCover) {
}
sa.store.set('openid', openid);
sa.identify(openid, true);
sa.bind('$identity_mp_openid', openid);

var name = _.getOpenidNameByAppid();
sa.store._state.identities[name] = openid;
sa.store.save();
};

sa.unsetOpenid = function(val) {
Expand All @@ -2492,13 +2495,18 @@ sa.unsetOpenid = function(val) {
sa.store.set('openid', '');
}

sa.unbind('$identity_mp_openid', id);
var name = _.getOpenidNameByAppid();
if (sa.store._state.identities.hasOwnProperty(name) && id === sa.store._state.identities[name]) {
delete sa.store._state.identities[name];
sa.store.save();
}
};

sa.setUnionid = function(val) {
var id = _.validId(val);
if (id) {
sa.bind('$identity_mp_unionid', id);
sa.store._state.identities['$identity_mp_unionid'] = id;
sa.store.save();
}
};

Expand All @@ -2512,8 +2520,9 @@ sa.unsetUnionid = function(val) {
delete sa.store._state.openid;
sa.store.save();
}
delete sa.store._state.identities['$identity_mp_unionid'];
sa.store.save();
}
sa.unbind('$identity_mp_unionid', id);
}
};

Expand Down Expand Up @@ -2545,7 +2554,7 @@ sa.bind = function(name, value) {
logger.info('Key must be String');
return false;
}
if (!_.check.checkKeyword(name) || name === '$identity_anonymous_id' || name === '$mp_id' || name === '$identity_mp_id' || name === '$identity_login_id' || name === sa.para.login_id_key) {
if (!_.check.checkKeyword(name) || name === '$identity_anonymous_id' || name === '$mp_id' || name === '$identity_mp_id' || name === '$mp_openid' || name === '$identity_mp_openid' || name === '$identity_mp_unionid' || name === '$mp_unionid' || name === '$identity_login_id' || name === sa.para.login_id_key) {
var info = 'Key [' + name + '] is invalid';
logger.info(info);
return false;
Expand All @@ -2564,9 +2573,6 @@ sa.bind = function(name, value) {
return false;
}
var identities = sa.store._state.identities;
if (name === '$identity_mp_openid') {
name = _.getOpenidNameByAppid();
}
identities[name] = value;
sa.store.save();

Expand All @@ -2588,7 +2594,7 @@ sa.unbind = function(name, value) {
logger.info('Key must be String');
return false;
}
if (!_.check.checkKeyword(name) || name === '$identity_anonymous_id' || name === '$mp_id' || name === '$identity_mp_id' || name === '$identity_login_id' || name === sa.para.login_id_key) {
if (!_.check.checkKeyword(name) || name === '$identity_anonymous_id' || name === '$mp_id' || name === '$identity_mp_id' || name === '$mp_openid' || name === '$identity_mp_openid' || name === '$identity_mp_unionid' || name === '$mp_unionid' || name === '$identity_login_id' || name === sa.para.login_id_key) {
var info = 'Key [' + name + '] is invalid';
logger.info(info);
return false;
Expand All @@ -2606,9 +2612,6 @@ sa.unbind = function(name, value) {
logger.info(info);
return false;
}
if (name === '$identity_mp_openid') {
name = _.getOpenidNameByAppid();
}
if (sa.store._state.identities.hasOwnProperty(name) && value === sa.store._state.identities[name]) {
delete sa.store._state.identities[name];
sa.store.save();
Expand Down
29 changes: 16 additions & 13 deletions product/sensorsdata.full.js
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ var ArrayProto = Array.prototype,
slice = ArrayProto.slice,
toString$1 = ObjProto.toString,
hasOwnProperty = ObjProto.hasOwnProperty,
LIB_VERSION = '1.16.2',
LIB_VERSION = '1.16.3',
LIB_NAME = 'MiniProgram';

var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term';
Expand Down Expand Up @@ -2482,7 +2482,10 @@ sa.setOpenid = function(openid, isCover) {
}
sa.store.set('openid', openid);
sa.identify(openid, true);
sa.bind('$identity_mp_openid', openid);

var name = _.getOpenidNameByAppid();
sa.store._state.identities[name] = openid;
sa.store.save();
};

sa.unsetOpenid = function(val) {
Expand All @@ -2495,13 +2498,18 @@ sa.unsetOpenid = function(val) {
sa.store.set('openid', '');
}

sa.unbind('$identity_mp_openid', id);
var name = _.getOpenidNameByAppid();
if (sa.store._state.identities.hasOwnProperty(name) && id === sa.store._state.identities[name]) {
delete sa.store._state.identities[name];
sa.store.save();
}
};

sa.setUnionid = function(val) {
var id = _.validId(val);
if (id) {
sa.bind('$identity_mp_unionid', id);
sa.store._state.identities['$identity_mp_unionid'] = id;
sa.store.save();
}
};

Expand All @@ -2515,8 +2523,9 @@ sa.unsetUnionid = function(val) {
delete sa.store._state.openid;
sa.store.save();
}
delete sa.store._state.identities['$identity_mp_unionid'];
sa.store.save();
}
sa.unbind('$identity_mp_unionid', id);
}
};

Expand Down Expand Up @@ -2548,7 +2557,7 @@ sa.bind = function(name, value) {
logger.info('Key must be String');
return false;
}
if (!_.check.checkKeyword(name) || name === '$identity_anonymous_id' || name === '$mp_id' || name === '$identity_mp_id' || name === '$identity_login_id' || name === sa.para.login_id_key) {
if (!_.check.checkKeyword(name) || name === '$identity_anonymous_id' || name === '$mp_id' || name === '$identity_mp_id' || name === '$mp_openid' || name === '$identity_mp_openid' || name === '$identity_mp_unionid' || name === '$mp_unionid' || name === '$identity_login_id' || name === sa.para.login_id_key) {
var info = 'Key [' + name + '] is invalid';
logger.info(info);
return false;
Expand All @@ -2567,9 +2576,6 @@ sa.bind = function(name, value) {
return false;
}
var identities = sa.store._state.identities;
if (name === '$identity_mp_openid') {
name = _.getOpenidNameByAppid();
}
identities[name] = value;
sa.store.save();

Expand All @@ -2591,7 +2597,7 @@ sa.unbind = function(name, value) {
logger.info('Key must be String');
return false;
}
if (!_.check.checkKeyword(name) || name === '$identity_anonymous_id' || name === '$mp_id' || name === '$identity_mp_id' || name === '$identity_login_id' || name === sa.para.login_id_key) {
if (!_.check.checkKeyword(name) || name === '$identity_anonymous_id' || name === '$mp_id' || name === '$identity_mp_id' || name === '$mp_openid' || name === '$identity_mp_openid' || name === '$identity_mp_unionid' || name === '$mp_unionid' || name === '$identity_login_id' || name === sa.para.login_id_key) {
var info = 'Key [' + name + '] is invalid';
logger.info(info);
return false;
Expand All @@ -2609,9 +2615,6 @@ sa.unbind = function(name, value) {
logger.info(info);
return false;
}
if (name === '$identity_mp_openid') {
name = _.getOpenidNameByAppid();
}
if (sa.store._state.identities.hasOwnProperty(name) && value === sa.store._state.identities[name]) {
delete sa.store._state.identities[name];
sa.store.save();
Expand Down
Loading

0 comments on commit a6aa28c

Please sign in to comment.