Skip to content

Commit 9978e89

Browse files
author
shengyonggen
committed
Release 1.17.13
1 parent 0df871f commit 9978e89

14 files changed

+53
-49
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.17.13(2022-9-16)
2+
1. 修复
3+
- 修复无法解绑 `$identity_mp_unionid` 的问题
4+
15
## 1.17.12(2022-8-12)
26
1. 新增
37
- 分享事件支持异步采集分享者信息

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sa-sdk-miniprogram",
3-
"version": "1.17.12",
3+
"version": "1.17.13",
44
"description": "sensorsdata miniprogram sdk",
55
"main": "sensorsdata.min.js",
66
"scripts": {

product/sensorsdata.custom.es6.full.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,7 @@ function isSameAndAnonymousID(id) {
833833
}
834834

835835
function isPresetIdKeys(name, ids) {
836-
var keyList = ['$identity_anonymous_id', '$mp_openid', '$identity_mp_openid', '$identity_mp_unionid', '$mp_unionid'];
836+
var keyList = ['$identity_anonymous_id'];
837837
if (isArray(ids)) {
838838
keyList = keyList.concat(ids);
839839
}
@@ -1011,7 +1011,7 @@ sa.getServerUrl = function() {
10111011
return sa.para.server_url;
10121012
};
10131013

1014-
var LIB_VERSION = '1.17.12',
1014+
var LIB_VERSION = '1.17.13',
10151015
LIB_NAME = 'MiniProgram';
10161016

10171017
var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term';
@@ -2707,7 +2707,8 @@ sa.loginWithKey = function(name, id) {
27072707
logger.info(info);
27082708
return false;
27092709
}
2710-
if (isPresetIdKeys(name, ['$mp_id', '$identity_mp_id'])) {
2710+
var listKeys = ['$mp_openid', '$identity_mp_openid', '$identity_mp_unionid', '$mp_unionid', '$mp_id', '$identity_mp_id'];
2711+
if (isPresetIdKeys(name, listKeys)) {
27112712
var info = 'Key [' + name + '] is invalid';
27122713
logger.info(info);
27132714
return false;
@@ -2924,8 +2925,7 @@ sa.unsetOpenid = function(val) {
29242925
sa.setUnionid = function(val) {
29252926
var id = _.validId(val);
29262927
if (id) {
2927-
sa.store._state.identities['$identity_mp_unionid'] = id;
2928-
sa.store.save();
2928+
sa.bind('$identity_mp_unionid', id);
29292929
}
29302930
};
29312931

@@ -2939,9 +2939,8 @@ sa.unsetUnionid = function(val) {
29392939
delete sa.store._state.openid;
29402940
sa.store.save();
29412941
}
2942-
delete sa.store._state.identities['$identity_mp_unionid'];
2943-
sa.store.save();
29442942
}
2943+
sa.unbind('$identity_mp_unionid', id);
29452944
}
29462945
};
29472946

@@ -3042,6 +3041,7 @@ sa.unbind = function(name, value) {
30423041
}
30433042
sa.store.save();
30443043
}
3044+
30453045
var distinctId = sa.store.getDistinctId();
30463046
var firstId = sa.store.getFirstId();
30473047
var unbindDistinctId = name + '+' + value;

product/sensorsdata.custom.full.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ function isSameAndAnonymousID(id) {
836836
}
837837

838838
function isPresetIdKeys(name, ids) {
839-
var keyList = ['$identity_anonymous_id', '$mp_openid', '$identity_mp_openid', '$identity_mp_unionid', '$mp_unionid'];
839+
var keyList = ['$identity_anonymous_id'];
840840
if (isArray(ids)) {
841841
keyList = keyList.concat(ids);
842842
}
@@ -1014,7 +1014,7 @@ sa.getServerUrl = function() {
10141014
return sa.para.server_url;
10151015
};
10161016

1017-
var LIB_VERSION = '1.17.12',
1017+
var LIB_VERSION = '1.17.13',
10181018
LIB_NAME = 'MiniProgram';
10191019

10201020
var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term';
@@ -2710,7 +2710,8 @@ sa.loginWithKey = function(name, id) {
27102710
logger.info(info);
27112711
return false;
27122712
}
2713-
if (isPresetIdKeys(name, ['$mp_id', '$identity_mp_id'])) {
2713+
var listKeys = ['$mp_openid', '$identity_mp_openid', '$identity_mp_unionid', '$mp_unionid', '$mp_id', '$identity_mp_id'];
2714+
if (isPresetIdKeys(name, listKeys)) {
27142715
var info = 'Key [' + name + '] is invalid';
27152716
logger.info(info);
27162717
return false;
@@ -2927,8 +2928,7 @@ sa.unsetOpenid = function(val) {
29272928
sa.setUnionid = function(val) {
29282929
var id = _.validId(val);
29292930
if (id) {
2930-
sa.store._state.identities['$identity_mp_unionid'] = id;
2931-
sa.store.save();
2931+
sa.bind('$identity_mp_unionid', id);
29322932
}
29332933
};
29342934

@@ -2942,9 +2942,8 @@ sa.unsetUnionid = function(val) {
29422942
delete sa.store._state.openid;
29432943
sa.store.save();
29442944
}
2945-
delete sa.store._state.identities['$identity_mp_unionid'];
2946-
sa.store.save();
29472945
}
2946+
sa.unbind('$identity_mp_unionid', id);
29482947
}
29492948
};
29502949

@@ -3045,6 +3044,7 @@ sa.unbind = function(name, value) {
30453044
}
30463045
sa.store.save();
30473046
}
3047+
30483048
var distinctId = sa.store.getDistinctId();
30493049
var firstId = sa.store.getFirstId();
30503050
var unbindDistinctId = name + '+' + value;

product/sensorsdata.es6.full.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,7 @@ function isSameAndAnonymousID(id) {
10451045
}
10461046

10471047
function isPresetIdKeys(name, ids) {
1048-
var keyList = ['$identity_anonymous_id', '$mp_openid', '$identity_mp_openid', '$identity_mp_unionid', '$mp_unionid'];
1048+
var keyList = ['$identity_anonymous_id'];
10491049
if (isArray(ids)) {
10501050
keyList = keyList.concat(ids);
10511051
}
@@ -1223,7 +1223,7 @@ sa.getServerUrl = function() {
12231223
return sa.para.server_url;
12241224
};
12251225

1226-
var LIB_VERSION = '1.17.12',
1226+
var LIB_VERSION = '1.17.13',
12271227
LIB_NAME = 'MiniProgram';
12281228

12291229
var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term';
@@ -2919,7 +2919,8 @@ sa.loginWithKey = function(name, id) {
29192919
logger.info(info);
29202920
return false;
29212921
}
2922-
if (isPresetIdKeys(name, ['$mp_id', '$identity_mp_id'])) {
2922+
var listKeys = ['$mp_openid', '$identity_mp_openid', '$identity_mp_unionid', '$mp_unionid', '$mp_id', '$identity_mp_id'];
2923+
if (isPresetIdKeys(name, listKeys)) {
29232924
var info = 'Key [' + name + '] is invalid';
29242925
logger.info(info);
29252926
return false;
@@ -3136,8 +3137,7 @@ sa.unsetOpenid = function(val) {
31363137
sa.setUnionid = function(val) {
31373138
var id = _.validId(val);
31383139
if (id) {
3139-
sa.store._state.identities['$identity_mp_unionid'] = id;
3140-
sa.store.save();
3140+
sa.bind('$identity_mp_unionid', id);
31413141
}
31423142
};
31433143

@@ -3151,9 +3151,8 @@ sa.unsetUnionid = function(val) {
31513151
delete sa.store._state.openid;
31523152
sa.store.save();
31533153
}
3154-
delete sa.store._state.identities['$identity_mp_unionid'];
3155-
sa.store.save();
31563154
}
3155+
sa.unbind('$identity_mp_unionid', id);
31573156
}
31583157
};
31593158

@@ -3254,6 +3253,7 @@ sa.unbind = function(name, value) {
32543253
}
32553254
sa.store.save();
32563255
}
3256+
32573257
var distinctId = sa.store.getDistinctId();
32583258
var firstId = sa.store.getFirstId();
32593259
var unbindDistinctId = name + '+' + value;

product/sensorsdata.full.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,7 @@ function isSameAndAnonymousID(id) {
10481048
}
10491049

10501050
function isPresetIdKeys(name, ids) {
1051-
var keyList = ['$identity_anonymous_id', '$mp_openid', '$identity_mp_openid', '$identity_mp_unionid', '$mp_unionid'];
1051+
var keyList = ['$identity_anonymous_id'];
10521052
if (isArray(ids)) {
10531053
keyList = keyList.concat(ids);
10541054
}
@@ -1226,7 +1226,7 @@ sa.getServerUrl = function() {
12261226
return sa.para.server_url;
12271227
};
12281228

1229-
var LIB_VERSION = '1.17.12',
1229+
var LIB_VERSION = '1.17.13',
12301230
LIB_NAME = 'MiniProgram';
12311231

12321232
var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term';
@@ -2922,7 +2922,8 @@ sa.loginWithKey = function(name, id) {
29222922
logger.info(info);
29232923
return false;
29242924
}
2925-
if (isPresetIdKeys(name, ['$mp_id', '$identity_mp_id'])) {
2925+
var listKeys = ['$mp_openid', '$identity_mp_openid', '$identity_mp_unionid', '$mp_unionid', '$mp_id', '$identity_mp_id'];
2926+
if (isPresetIdKeys(name, listKeys)) {
29262927
var info = 'Key [' + name + '] is invalid';
29272928
logger.info(info);
29282929
return false;
@@ -3139,8 +3140,7 @@ sa.unsetOpenid = function(val) {
31393140
sa.setUnionid = function(val) {
31403141
var id = _.validId(val);
31413142
if (id) {
3142-
sa.store._state.identities['$identity_mp_unionid'] = id;
3143-
sa.store.save();
3143+
sa.bind('$identity_mp_unionid', id);
31443144
}
31453145
};
31463146

@@ -3154,9 +3154,8 @@ sa.unsetUnionid = function(val) {
31543154
delete sa.store._state.openid;
31553155
sa.store.save();
31563156
}
3157-
delete sa.store._state.identities['$identity_mp_unionid'];
3158-
sa.store.save();
31593157
}
3158+
sa.unbind('$identity_mp_unionid', id);
31603159
}
31613160
};
31623161

@@ -3257,6 +3256,7 @@ sa.unbind = function(name, value) {
32573256
}
32583257
sa.store.save();
32593258
}
3259+
32603260
var distinctId = sa.store.getDistinctId();
32613261
var firstId = sa.store.getFirstId();
32623262
var unbindDistinctId = name + '+' + value;

product/sensorsdata.plugin.es6.full.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ function isSameAndAnonymousID(id) {
10421042
}
10431043

10441044
function isPresetIdKeys(name, ids) {
1045-
var keyList = ['$identity_anonymous_id', '$mp_openid', '$identity_mp_openid', '$identity_mp_unionid', '$mp_unionid'];
1045+
var keyList = ['$identity_anonymous_id'];
10461046
if (isArray(ids)) {
10471047
keyList = keyList.concat(ids);
10481048
}
@@ -1220,7 +1220,7 @@ sa.getServerUrl = function() {
12201220
return sa.para.server_url;
12211221
};
12221222

1223-
var LIB_VERSION = '1.17.12',
1223+
var LIB_VERSION = '1.17.13',
12241224
LIB_NAME = 'MiniProgram';
12251225

12261226
var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term';
@@ -2916,7 +2916,8 @@ sa.loginWithKey = function(name, id) {
29162916
logger.info(info);
29172917
return false;
29182918
}
2919-
if (isPresetIdKeys(name, ['$mp_id', '$identity_mp_id'])) {
2919+
var listKeys = ['$mp_openid', '$identity_mp_openid', '$identity_mp_unionid', '$mp_unionid', '$mp_id', '$identity_mp_id'];
2920+
if (isPresetIdKeys(name, listKeys)) {
29202921
var info = 'Key [' + name + '] is invalid';
29212922
logger.info(info);
29222923
return false;
@@ -3133,8 +3134,7 @@ sa.unsetOpenid = function(val) {
31333134
sa.setUnionid = function(val) {
31343135
var id = _.validId(val);
31353136
if (id) {
3136-
sa.store._state.identities['$identity_mp_unionid'] = id;
3137-
sa.store.save();
3137+
sa.bind('$identity_mp_unionid', id);
31383138
}
31393139
};
31403140

@@ -3148,9 +3148,8 @@ sa.unsetUnionid = function(val) {
31483148
delete sa.store._state.openid;
31493149
sa.store.save();
31503150
}
3151-
delete sa.store._state.identities['$identity_mp_unionid'];
3152-
sa.store.save();
31533151
}
3152+
sa.unbind('$identity_mp_unionid', id);
31543153
}
31553154
};
31563155

@@ -3251,6 +3250,7 @@ sa.unbind = function(name, value) {
32513250
}
32523251
sa.store.save();
32533252
}
3253+
32543254
var distinctId = sa.store.getDistinctId();
32553255
var firstId = sa.store.getFirstId();
32563256
var unbindDistinctId = name + '+' + value;

product/sensorsdata.plugin.full.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,7 @@ function isSameAndAnonymousID(id) {
10451045
}
10461046

10471047
function isPresetIdKeys(name, ids) {
1048-
var keyList = ['$identity_anonymous_id', '$mp_openid', '$identity_mp_openid', '$identity_mp_unionid', '$mp_unionid'];
1048+
var keyList = ['$identity_anonymous_id'];
10491049
if (isArray(ids)) {
10501050
keyList = keyList.concat(ids);
10511051
}
@@ -1223,7 +1223,7 @@ sa.getServerUrl = function() {
12231223
return sa.para.server_url;
12241224
};
12251225

1226-
var LIB_VERSION = '1.17.12',
1226+
var LIB_VERSION = '1.17.13',
12271227
LIB_NAME = 'MiniProgram';
12281228

12291229
var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term';
@@ -2919,7 +2919,8 @@ sa.loginWithKey = function(name, id) {
29192919
logger.info(info);
29202920
return false;
29212921
}
2922-
if (isPresetIdKeys(name, ['$mp_id', '$identity_mp_id'])) {
2922+
var listKeys = ['$mp_openid', '$identity_mp_openid', '$identity_mp_unionid', '$mp_unionid', '$mp_id', '$identity_mp_id'];
2923+
if (isPresetIdKeys(name, listKeys)) {
29232924
var info = 'Key [' + name + '] is invalid';
29242925
logger.info(info);
29252926
return false;
@@ -3136,8 +3137,7 @@ sa.unsetOpenid = function(val) {
31363137
sa.setUnionid = function(val) {
31373138
var id = _.validId(val);
31383139
if (id) {
3139-
sa.store._state.identities['$identity_mp_unionid'] = id;
3140-
sa.store.save();
3140+
sa.bind('$identity_mp_unionid', id);
31413141
}
31423142
};
31433143

@@ -3151,9 +3151,8 @@ sa.unsetUnionid = function(val) {
31513151
delete sa.store._state.openid;
31523152
sa.store.save();
31533153
}
3154-
delete sa.store._state.identities['$identity_mp_unionid'];
3155-
sa.store.save();
31563154
}
3155+
sa.unbind('$identity_mp_unionid', id);
31573156
}
31583157
};
31593158

@@ -3254,6 +3253,7 @@ sa.unbind = function(name, value) {
32543253
}
32553254
sa.store.save();
32563255
}
3256+
32573257
var distinctId = sa.store.getDistinctId();
32583258
var firstId = sa.store.getFirstId();
32593259
var unbindDistinctId = name + '+' + value;

sensorsdata.custom.es6.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sensorsdata.custom.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)