auto-point 0.0.24 → 0.0.25

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.
package/AP/auto_point.js CHANGED
@@ -104,7 +104,7 @@
104
104
  this.#EVENTS = params.events
105
105
  }
106
106
  if(params.send_func && this.#isFunction(params.send_func, "send_func must be a function")){
107
- this.#SEND_FUNC = params.send_func.bind(this)
107
+ this.#SEND_FUNC = params.send_func
108
108
  }
109
109
  this.#POINT_SYS_INIT_TIME = new Date().getTime()
110
110
  this.#mount_dom_event()
package/README.md CHANGED
@@ -24,16 +24,9 @@ const ap = new AP().init({
24
24
  interval_time: 5000, // 发送间隔:5秒
25
25
  events: ['click'], // 监听的事件类型
26
26
  point_sing: 'data-track-id', // 埋点标记属性名 如果元素上带有该属性名,AP会自动记录该属性值,否则不会记录
27
- send_func: function(data){ // 自定义发送函数,默认使用fetch发送数据
28
- return fetch(this.#SERVER, {
29
- method: 'POST',
30
- headers: {
31
- 'Content-Type': 'application/json',
32
- },
33
- body: JSON.stringify(data),
34
- keepalive: true // 保持连接,确保数据发送完成
35
- });
36
- }
27
+ send_func: function(data){
28
+ // 自定义发送函数,默认使用fetch发送数据,data为埋点数据
29
+ }
37
30
  });
38
31
 
39
32
  // 挂载中间件(在发送数据前执行)
package/package.json CHANGED
@@ -13,5 +13,5 @@
13
13
  "scripts": {
14
14
  "test": "echo \"Error: no test specified\" && exit 1"
15
15
  },
16
- "version": "0.0.24"
16
+ "version": "0.0.25"
17
17
  }