gio-miniprogram-sdk 4.0.1 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/dist/alipay.js +1 -1
  2. package/dist/baidu.js +1 -1
  3. package/dist/bytedance.js +1 -1
  4. package/dist/jingdong.js +1 -1
  5. package/dist/kuaishou.js +1 -1
  6. package/dist/plugins/gioABTest.js +1 -1
  7. package/dist/plugins/gioCompress.js +1 -1
  8. package/dist/plugins/gioEventAutoTracking.js +1 -1
  9. package/dist/plugins/gioImpressionTracking.js +1 -1
  10. package/dist/plugins/gioMultipleInstances.js +1 -0
  11. package/dist/qq.js +1 -1
  12. package/dist/quickapp.js +1 -1
  13. package/dist/taobao.js +1 -1
  14. package/dist/taro.js +1 -1
  15. package/dist/uniapp.js +1 -1
  16. package/dist/wechat.js +1 -1
  17. package/package.json +39 -42
  18. package/rollup.config.js +11 -6
  19. package/rollup.plugins.config.js +13 -10
  20. package/src/{pluginsOut/frameworks → adapters}/gioTaobaoAdapter.ts +47 -43
  21. package/src/{pluginsOut/frameworks → adapters}/gioTaroAdapter.ts +4 -4
  22. package/src/{pluginsOut/frameworks → adapters}/gioUniAppAdapter.ts +35 -6
  23. package/src/constants/config.ts +47 -18
  24. package/src/constants/emitMsg.ts +23 -0
  25. package/src/constants/regex.ts +0 -1
  26. package/src/core/dataStore/eventContextBuilder.ts +28 -17
  27. package/src/core/dataStore/eventHooks/appEffects.ts +50 -31
  28. package/src/core/dataStore/eventHooks/index.ts +7 -5
  29. package/src/core/dataStore/eventHooks/minipPage.ts +2 -11
  30. package/src/core/dataStore/eventHooks/pageEffects.ts +61 -27
  31. package/src/core/dataStore/index.ts +263 -185
  32. package/src/core/growingIO.ts +312 -178
  33. package/src/core/pluginsInstance/base.ts +157 -0
  34. package/src/core/pluginsInstance/taro.ts +15 -0
  35. package/src/core/pluginsInstance/tb.ts +15 -0
  36. package/src/core/pluginsInstance/uniapp.ts +15 -0
  37. package/src/core/uploader.ts +131 -82
  38. package/src/core/userStore.ts +160 -121
  39. package/src/index.ts +37 -28
  40. package/src/minipInstance/base.ts +2 -1
  41. package/src/minipInstance/quickapp.ts +5 -19
  42. package/src/platformConfig/base.ts +0 -4
  43. package/src/{pluginsOut/ordinary → plugins}/gioABTest.ts +74 -37
  44. package/src/{pluginsOut/ordinary → plugins}/gioEventAutoTracking.ts +25 -18
  45. package/src/{pluginsOut/ordinary → plugins}/gioImpressionTracking.ts +55 -22
  46. package/src/plugins/gioMultipleInstances.ts +176 -0
  47. package/src/types/base.ts +10 -3
  48. package/src/types/dataStore.ts +31 -16
  49. package/src/types/eventHooks.ts +5 -6
  50. package/src/types/growingIO.ts +30 -14
  51. package/src/types/platforms.ts +0 -4
  52. package/src/types/plugins.ts +1 -1
  53. package/src/types/uploader.ts +16 -10
  54. package/src/types/userStore.ts +21 -17
  55. package/src/utils/glodash.ts +10 -3
  56. package/src/utils/tools.ts +27 -6
  57. package/src/utils/verifiers.ts +25 -50
  58. package/typings/global.d.ts +5 -0
  59. package/.babelrc +0 -4
  60. package/bin/build/full.sh +0 -32
  61. package/bin/build/jd.sh +0 -14
  62. package/bin/build/ks.sh +0 -14
  63. package/bin/build/my.sh +0 -14
  64. package/bin/build/plugins.sh +0 -5
  65. package/bin/build/qq.sh +0 -14
  66. package/bin/build/quickapp.sh +0 -14
  67. package/bin/build/swan.sh +0 -14
  68. package/bin/build/taro.sh +0 -18
  69. package/bin/build/tb.sh +0 -18
  70. package/bin/build/tt.sh +0 -14
  71. package/bin/build/uniapp.sh +0 -18
  72. package/bin/build/wx.sh +0 -14
  73. package/src/core/plugins.ts +0 -152
  74. package/src/pluginsOut/ordinary/gioCustomTracking.ts +0 -71
  75. package/bin/{build/all.sh → build.sh} +3 -3
  76. /package/src/{pluginsOut/ordinary → plugins}/gioCompress.ts +0 -0
@@ -1,6 +1,9 @@
1
+ import { batchGetStorageSync, batchSetStorageSync, guid } from '@@/utils/tools';
1
2
  import { GrowingIOType } from '@@/types/growingIO';
3
+ import { isNil } from '@@/utils/glodash';
4
+ import { StringObject } from '@@/types/base';
2
5
  import { UserStoreType } from '@@/types/userStore';
3
- import { batchGetStorageSync, batchSetStorageSync, guid } from '@@/utils/tools';
6
+ import EMIT_MSG from '@@/constants/emitMsg';
4
7
 
5
8
  /**
6
9
  * 代码中与3.0测量协议字段对应关系
@@ -13,190 +16,226 @@ import { batchGetStorageSync, batchSetStorageSync, guid } from '@@/utils/tools';
13
16
  */
14
17
 
15
18
  class UserStore implements UserStoreType {
16
- // 访问用户id在存储中的名称
17
- public uidStorageName: string;
18
- // 登录用户id在存储中的名称
19
- public userIdStorageName: string;
20
- // 登录用户key在存储中的名称
21
- public userKeyStorageName: string;
22
- // 最后一次登录用户id在存储中的名称
23
- public gioIdStorageName: string;
24
- // 用户访问会话id
25
- public _sessionId: string;
26
- // 访问用户id(系统设置持久性存储)
19
+ // 访问用户id/设备id(系统设置持久性存储)
27
20
  public _uid: string;
21
+ // 用户访问会话id
22
+ public _sessionId: StringObject;
28
23
  // 登录用户id(客户设置持久性存储)
29
- public _userId: string;
24
+ public _userId: StringObject;
30
25
  // 登录用户key(客户设置持久性存储)
31
- public _userKey: string;
26
+ public _userKey: StringObject;
32
27
  // 最后一次登录用户id(持久性存储)
33
- public _gioId: string;
28
+ public _gioId: StringObject;
34
29
  constructor(public growingIO: GrowingIOType) {
35
- const { inPlugin } = this.growingIO;
36
- this.uidStorageName = inPlugin ? '_growing_plugin_uid_' : '_growing_uid_';
37
- this.userIdStorageName = inPlugin
38
- ? '_growing_plugin_userId_'
39
- : '_growing_userId_';
40
- this.userKeyStorageName = inPlugin
41
- ? '_growing_plugin_userKey_'
42
- : '_growing_userKey_';
43
- this.gioIdStorageName = inPlugin
44
- ? '_growing_plugin_gioId_'
45
- : '_growing_gioId_';
46
- this._sessionId = guid();
47
30
  this._uid = undefined;
48
- this._userId = undefined;
49
- this._userKey = undefined;
50
- this._gioId = undefined;
51
- if (this.growingIO?.gioPlatform !== 'quickapp') {
52
- this.initUserInfo();
53
- }
31
+ this._sessionId = {};
32
+ this._userId = {};
33
+ this._userKey = {};
34
+ this._gioId = {};
54
35
  }
55
36
 
56
- // @ts-ignore
57
- get sessionId() {
58
- if (!this._sessionId) {
59
- this._sessionId = guid();
60
- }
61
- return this._sessionId;
62
- }
37
+ // 获取sessionId存储key
38
+ _getUidKey = () =>
39
+ this.growingIO.inPlugin ? '_growing_plugin_uid_' : '_growing_uid_';
63
40
 
64
- // @ts-ignore
65
- set sessionId(id: string) {
66
- const prevId = this._sessionId;
67
- if (!id) {
68
- this._sessionId = guid();
69
- } else {
70
- this._sessionId = id;
41
+ // 获取设备Id
42
+ getUid = () => {
43
+ const { minipInstance } = this.growingIO;
44
+ // 内存中拿不到尝试从存储中拿
45
+ if (!this._uid) {
46
+ this._uid = minipInstance.getStorageSync(this._getUidKey());
71
47
  }
72
- // 广播通知登录sessionId变更
73
- if (prevId !== this._sessionId) {
74
- this.growingIO.emitter.emit('SESSIONID_UPDATE', {
75
- newSessionId: this._sessionId,
76
- oldSessionId: prevId
77
- });
48
+ // 存储中拿不到尝试设新值
49
+ if (!this._uid) {
50
+ this._uid = guid();
51
+ minipInstance.setStorage(this._getUidKey(), this._uid);
78
52
  }
79
- }
80
-
81
- // @ts-ignore
82
- get uid() {
83
53
  return this._uid;
84
- }
54
+ };
85
55
 
86
- // @ts-ignore
87
- set uid(id: string) {
56
+ // 设置设备Id
57
+ setUid = (id: string) => {
88
58
  const prevId = this._uid;
89
59
  this._uid = id;
90
60
  if (prevId !== this._uid) {
91
- this.growingIO.minipInstance.setStorage(this.uidStorageName, this._uid);
61
+ this.growingIO.minipInstance.setStorage(this._getUidKey(), this._uid);
92
62
  // 广播通知访问用户Id变更
93
- this.growingIO.emitter.emit('UID_UPDATE', {
63
+ this.growingIO.emitter.emit(EMIT_MSG.UID_UPDATE, {
94
64
  newUId: id,
95
65
  oldUId: prevId
96
66
  });
97
67
  }
98
- }
68
+ };
99
69
 
100
- // @ts-ignore
101
- get userId() {
102
- return this._userId;
103
- }
70
+ // 获取sessionId
71
+ getSessionId = (trackingId: string) => {
72
+ if (!this._sessionId[trackingId]) {
73
+ this.setSessionId(trackingId);
74
+ }
75
+ return this._sessionId[trackingId];
76
+ };
104
77
 
105
- // @ts-ignore
106
- set userId(id: string) {
107
- const prevId = this._userId;
108
- this._userId = id;
109
- if (prevId !== this._userId) {
78
+ // 设置sessionId
79
+ setSessionId = (trackingId: string, id?: string) => {
80
+ const prevId = this._sessionId[trackingId];
81
+ if (!id) {
82
+ id = guid();
83
+ }
84
+ // 小程序中sessionId只需要在内存中存储就可以,不需要持久化存储
85
+ this._sessionId[trackingId] = id;
86
+ // 广播通知登录sessionId变更
87
+ if (prevId !== id) {
88
+ this.growingIO.emitter.emit(EMIT_MSG.SESSIONID_UPDATE, {
89
+ newSessionId: id,
90
+ oldSessionId: prevId
91
+ });
92
+ }
93
+ };
94
+
95
+ // 获取userId存储key
96
+ _getUserIdKey = (trackingId: string) =>
97
+ this.growingIO.dataStore.getStorageKey(trackingId, 'userId');
98
+
99
+ // 获取userId
100
+ getUserId = (trackingId: string) => {
101
+ const { minipInstance } = this.growingIO;
102
+ // 内存中拿不到尝试从存储中拿
103
+ if (!this._userId[trackingId]) {
104
+ this._userId[trackingId] = minipInstance.getStorageSync(
105
+ this._getUserIdKey(trackingId)
106
+ );
107
+ }
108
+ return this._userId[trackingId];
109
+ };
110
+
111
+ // 设置userId
112
+ setUserId = (trackingId: string, id: string) => {
113
+ const prevId = this._userId[trackingId];
114
+ this._userId[trackingId] = isNil(id) ? '' : id;
115
+ if (prevId !== this._userId[trackingId]) {
110
116
  this.growingIO.minipInstance.setStorage(
111
- this.userIdStorageName,
112
- this._userId
117
+ this._getUserIdKey(trackingId),
118
+ this._userId[trackingId]
113
119
  );
114
120
  // 广播通知登录用户Id变更
115
- this.growingIO.emitter.emit('USERID_UPDATE', {
121
+ this.growingIO.emitter.emit(EMIT_MSG.USERID_UPDATE, {
116
122
  newUserId: id,
117
123
  oldUserId: prevId
118
124
  });
119
125
  }
120
- if (id) this.gioId = id;
121
- }
126
+ if (id) this.setGioId(trackingId, id);
127
+ };
122
128
 
123
- // @ts-ignore
124
- get userKey() {
125
- return this._userKey;
126
- }
129
+ // 获取userKey存储key
130
+ _getUserKeyKey = (trackingId: string) =>
131
+ this.growingIO.dataStore.getStorageKey(trackingId, 'userKey');
127
132
 
128
- // @ts-ignore
129
- set userKey(key: string) {
130
- const prevKey = this._userKey;
131
- this._userKey = key;
132
- if (prevKey !== this._userKey) {
133
+ // 获取userKey
134
+ getUserKey = (trackingId: string) => {
135
+ const { minipInstance } = this.growingIO;
136
+ // 内存中拿不到尝试从存储中拿
137
+ if (!this._userKey[trackingId]) {
138
+ this._userKey[trackingId] = minipInstance.getStorageSync(
139
+ this._getUserKeyKey(trackingId)
140
+ );
141
+ }
142
+ return this._userKey[trackingId];
143
+ };
144
+
145
+ // 设置userKey
146
+ setUserKey = (trackingId: string, key: string) => {
147
+ const prevKey = this._userKey[trackingId];
148
+ this._userKey[trackingId] = isNil(key) ? '' : key;
149
+ if (prevKey !== this._userKey[trackingId]) {
133
150
  this.growingIO.minipInstance.setStorage(
134
- this.userKeyStorageName,
135
- this._userKey
151
+ this._getUserKeyKey(trackingId),
152
+ this._userKey[trackingId]
136
153
  );
137
154
  // 广播通知登录用户key变更
138
- this.growingIO.emitter.emit('USERKEY_UPDATE', {
155
+ this.growingIO.emitter.emit(EMIT_MSG.USERKEY_UPDATE, {
139
156
  newUserKey: key,
140
157
  oldUserKey: prevKey
141
158
  });
142
159
  }
143
- }
160
+ };
144
161
 
145
- // @ts-ignore
146
- get gioId() {
147
- return this._gioId;
148
- }
162
+ // 获取gioId存储key
163
+ _getGioIdKey = (trackingId: string) =>
164
+ this.growingIO.dataStore.getStorageKey(trackingId, 'gioId');
149
165
 
150
- // @ts-ignore
151
- set gioId(gioId: string) {
152
- const prevId = this._gioId;
153
- this._gioId = gioId;
154
- if (prevId !== this._gioId) {
166
+ // 获取gioId
167
+ getGioId = (trackingId: string) => {
168
+ const { minipInstance } = this.growingIO;
169
+ // 内存中拿不到尝试从存储中拿
170
+ if (!this._gioId[trackingId]) {
171
+ this._gioId[trackingId] = minipInstance.getStorageSync(
172
+ this._getGioIdKey(trackingId)
173
+ );
174
+ }
175
+ return this._gioId[trackingId];
176
+ };
177
+
178
+ // 设置gioId
179
+ setGioId = (trackingId: string, gioId: string) => {
180
+ const prevId = this._gioId[trackingId];
181
+ this._gioId[trackingId] = isNil(gioId) ? '' : gioId;
182
+ if (prevId !== this._gioId[trackingId]) {
155
183
  this.growingIO.minipInstance.setStorage(
156
- this.gioIdStorageName,
157
- this._gioId
184
+ this._getGioIdKey(trackingId),
185
+ this._gioId[trackingId]
158
186
  );
159
187
  // 广播通知登录用户Id变更
160
- this.growingIO.emitter.emit('GIOID_UPDATE', {
188
+ this.growingIO.emitter.emit(EMIT_MSG.GIOID_UPDATE, {
161
189
  newGioId: gioId,
162
190
  oldGioId: prevId
163
191
  });
164
192
  }
165
- }
193
+ };
166
194
 
167
195
  // 初始化用户信息
168
- initUserInfo = () => {
196
+ initUserInfo = (trackingId: string) => {
169
197
  const { minipInstance } = this.growingIO;
170
198
  const storeKeys = [
171
- this.uidStorageName,
172
- this.userIdStorageName,
173
- this.userKeyStorageName,
174
- this.gioIdStorageName
199
+ this._getUidKey(),
200
+ this._getUserIdKey(trackingId),
201
+ this._getUserKeyKey(trackingId),
202
+ this._getGioIdKey(trackingId)
175
203
  ];
176
204
  const memoryKeys = ['_uid', '_userId', '_userKey', '_gioId'];
177
205
  // 批量获取的存储数据
178
206
  const values = batchGetStorageSync(minipInstance, storeKeys) ?? [];
179
207
  // 往存储中重设的key
180
208
  memoryKeys.forEach((key: string, index: number) => {
181
- // 往内存中赋值
182
- this[key] = values[index];
183
- // 如果uid没有值,则自动生成并赋值(这种情况是用户第一次进或者清了缓存)
184
- if (key === '_uid' && !this[key]) {
185
- // this.uid会自动给内存和存储都赋值
186
- this.uid = guid();
209
+ if (key === '_uid') {
210
+ // 调用一次往内存里存一份
211
+ this.getUid();
212
+ } else {
213
+ // 往内存中赋值
214
+ this[key][trackingId] = values[index];
187
215
  }
188
216
  });
189
217
  };
190
218
 
191
219
  // 退出小程序时在存储中同步用户信息
192
220
  saveUserInfo = () => {
193
- const { minipInstance } = this.growingIO;
194
- batchSetStorageSync(minipInstance, [
195
- { key: this.uidStorageName, value: this.uid },
196
- { key: this.userIdStorageName, value: this.userId },
197
- { key: this.userKeyStorageName, value: this.userKey },
198
- { key: this.gioIdStorageName, value: this.gioId }
199
- ]);
221
+ const {
222
+ minipInstance,
223
+ dataStore: { trackersExecute }
224
+ } = this.growingIO;
225
+ trackersExecute((trackingId: string) => {
226
+ batchSetStorageSync(minipInstance, [
227
+ { key: this._getUidKey(), value: this._uid },
228
+ {
229
+ key: this._getUserIdKey(trackingId),
230
+ value: this._userId[trackingId]
231
+ },
232
+ {
233
+ key: this._getUserKeyKey(trackingId),
234
+ value: this._userKey[trackingId]
235
+ },
236
+ { key: this._getGioIdKey(trackingId), value: this._gioId[trackingId] }
237
+ ]);
238
+ });
200
239
  };
201
240
  }
202
241
 
package/src/index.ts CHANGED
@@ -1,52 +1,61 @@
1
- import {
2
- initPreCheck,
3
- paramExtraCheck,
4
- paramsBaseCheck,
5
- paramsEmptyCheck
6
- } from '@@/utils/verifiers';
1
+ import { initialCheck } from '@@/utils/verifiers';
7
2
  import { consoleText, getGlobal, niceTry } from '@@/utils/tools';
8
3
  import { drop, isString, toString } from '@@/utils/glodash';
9
- import { HANDLERS, DEPRECATED_HANDLERS } from '@@/constants/config';
4
+ import {
5
+ HANDLERS,
6
+ DEPRECATED_HANDLERS,
7
+ INSTANCE_HANDLERS
8
+ } from '@@/constants/config';
10
9
  import GrowingIO from './core/growingIO';
11
10
 
12
11
  const gioInstance: any = new GrowingIO();
13
12
 
14
13
  const gdp = function () {
15
- const actionName = arguments[0];
14
+ const handlerName = arguments[0];
15
+ let trackingId = 'g0';
16
+ let handler = handlerName;
17
+ if (handlerName.indexOf('.') > -1) {
18
+ trackingId = handlerName.split('.')[0] ?? 'g0'; // 没有指定trackingId,默认为g0
19
+ handler = handlerName.split('.')[1];
20
+ }
16
21
  // 判断指令为字符串且配置项中允许调用且实例中存在的方法
17
- if (
18
- isString(actionName) &&
19
- HANDLERS.includes(actionName) &&
20
- gioInstance[actionName]
21
- ) {
22
+ if (isString(handler) && HANDLERS.includes(handler) && gioInstance[handler]) {
22
23
  const args = drop(Array.from(arguments));
23
24
  // 初始化方法单独处理
24
- if (actionName === 'init') {
25
- const preCheckRes = initPreCheck(gioInstance);
26
- const emptyCheckRes = paramsEmptyCheck(args);
27
- const baseCheckRes = paramsBaseCheck(args);
28
- const extraCheckRes = paramExtraCheck(args);
29
- if (preCheckRes && emptyCheckRes && baseCheckRes && extraCheckRes) {
30
- const { projectId } = baseCheckRes;
31
- const { dataSourceId, appId, options } = extraCheckRes;
25
+ if (handler === 'init') {
26
+ const initialCheckRes: any = initialCheck(gioInstance, args);
27
+ if (initialCheckRes) {
28
+ const { projectId, dataSourceId, appId, userOptions } = initialCheckRes;
29
+ // 返回初始化结果
32
30
  return gioInstance.init({
33
- ...options,
31
+ ...userOptions,
34
32
  projectId,
35
33
  dataSourceId,
36
- appId
34
+ appId,
35
+ trackingId
37
36
  });
37
+ } else {
38
+ return false;
38
39
  }
39
- } else if (actionName === 'registerPlugins') {
40
+ } else if (handler === 'registerPlugins') {
40
41
  gioInstance.registerPlugins(args[0]);
41
42
  } else if (gioInstance.gioSDKInitialized && gioInstance.vdsConfig) {
42
- return gioInstance[actionName](...args);
43
+ if (INSTANCE_HANDLERS.includes(handler)) {
44
+ return niceTry(() =>
45
+ gioInstance.handlerDistribute(trackingId, handler, args)
46
+ );
47
+ } else {
48
+ return niceTry(() => gioInstance[handler](...args));
49
+ }
43
50
  } else {
44
51
  consoleText('SDK未初始化!', 'error');
45
52
  }
46
- } else if (DEPRECATED_HANDLERS.includes(actionName)) {
47
- consoleText(`方法 ${toString(actionName)} 已被弃用!`, 'warn');
53
+ } else if (DEPRECATED_HANDLERS.includes(handler)) {
54
+ consoleText(`方法 ${toString(handler)} 已被弃用,请移除!`, 'warn');
55
+ } else if (handler === 'canIUse') {
56
+ return HANDLERS.includes(arguments[1]) && !!gioInstance[arguments[1]];
48
57
  } else {
49
- consoleText(`不存在名为 ${toString(actionName)} 的方法调用!`, 'error');
58
+ consoleText(`不存在名为 ${toString(handler)} 的方法调用!`, 'error');
50
59
  }
51
60
  };
52
61
 
@@ -8,6 +8,7 @@ import {
8
8
  } from '@@/types/minipInstance';
9
9
  import { PLATFORMS } from '@@/types/platforms';
10
10
  import { isFunction, isObject, isString, last } from '@@/utils/glodash';
11
+ import EMIT_MSG from '@@/constants/emitMsg';
11
12
  import {
12
13
  limitString,
13
14
  niceTry,
@@ -32,7 +33,7 @@ class BaseInstance implements MinipInstanceType {
32
33
  } = this.growingIO;
33
34
  this.platform = platform;
34
35
  this.scnPrefix = scnPrefix;
35
- this.growingIO.emitter.on('OPTION_INITIALIZED', () => {
36
+ this.growingIO.emitter.on(EMIT_MSG.OPTION_INITIALIZED, () => {
36
37
  this.getNetworkType().then(() =>
37
38
  this.growingIO.dataStore?.eventReleaseInspector()
38
39
  );
@@ -1,9 +1,11 @@
1
1
  import { GrowingIOType } from '@@/types/growingIO';
2
- import { SystemInfo } from '@@/types/minipInstance';
3
2
  import { isString, last } from '@@/utils/glodash';
4
3
  import { limitString } from '@@/utils/tools';
4
+ import { SystemInfo } from '@@/types/minipInstance';
5
5
  import app from '@system.app';
6
+ import BaseImplements from './base';
6
7
  import device from '@system.device';
8
+ import EMIT_MSG from '@@/constants/emitMsg';
7
9
  import fetch from '@system.fetch';
8
10
  import image from '@system.image';
9
11
  import network from '@system.network';
@@ -11,12 +13,10 @@ import router from '@system.router';
11
13
  import share from '@system.share';
12
14
  import storage from '@system.storage';
13
15
 
14
- import BaseImplements from './base';
15
-
16
16
  class QuickApp extends BaseImplements {
17
17
  constructor(public growingIO: GrowingIOType) {
18
18
  super(growingIO);
19
- this.growingIO.emitter.on('minipLifecycle', ({ event }) => {
19
+ this.growingIO.emitter.on(EMIT_MSG.MINIP_LIFECYCLE, ({ event }) => {
20
20
  switch (event) {
21
21
  case 'App onCreate':
22
22
  {
@@ -76,24 +76,10 @@ class QuickApp extends BaseImplements {
76
76
 
77
77
  // 初始化分享
78
78
  initShareAppMessage = (growingIO: GrowingIOType) => {
79
- const { vdsConfig, platformConfig } = growingIO;
79
+ const { platformConfig } = growingIO;
80
80
  try {
81
81
  this.growingIO.shareAppMessage = function () {
82
82
  const params = arguments[0];
83
- if (
84
- params &&
85
- params.type &&
86
- !/^text.*/.test(params.type) &&
87
- params.data
88
- ) {
89
- if (vdsConfig.followShare) {
90
- if (params.data.indexOf('?') === -1) {
91
- params.data = params.data + '?suid=' + growingIO.userStore.uid;
92
- } else {
93
- params.data = params.data + '&suid=' + growingIO.userStore.uid;
94
- }
95
- }
96
- }
97
83
  share?.share(params);
98
84
  growingIO?.eventTracking?.pageEffects(
99
85
  this,
@@ -40,10 +40,6 @@ const Config: PlatformConfigType = {
40
40
  'contact',
41
41
  'mouseup'
42
42
  ],
43
- originalApp: niceTry(() => App),
44
- originalPage: niceTry(() => Page),
45
- originalComponent: niceTry(() => Component),
46
- originalBehavior: niceTry(() => Behavior),
47
43
  canHook: true,
48
44
  hooks: {
49
45
  App: true,