auto-point 0.0.28 → 0.0.30

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 (2) hide show
  1. package/AP/auto_point.js +3 -2
  2. package/package.json +1 -1
package/AP/auto_point.js CHANGED
@@ -92,7 +92,8 @@
92
92
  if (server && /^https?:\/\//.test(server)) { // server 是一个url
93
93
  return true
94
94
  } else {
95
- throw "The server in params cannot be empty"
95
+ message && this.#ERROR(message)
96
+ return false
96
97
  }
97
98
  }
98
99
 
@@ -217,6 +218,7 @@
217
218
  // 发送埋点数据
218
219
  async #send() {
219
220
  if (this.#POINT_LIST.length) {
221
+ this.#POINT_LAST_SEND_TIME = new Date().getTime() // 更新最后发送时间
220
222
  let point_list = this.#POINT_LIST
221
223
  for(let middleware of this.#MIDDLEWARE){
222
224
  if (this.#isFunction(middleware)) {
@@ -231,7 +233,6 @@
231
233
  console.error("Error sending data:", error)
232
234
  } finally {
233
235
  // 发送后清空埋点列表数据, 并更新最后发送时间
234
- this.#POINT_LAST_SEND_TIME = new Date().getTime() // 更新最后发送时间
235
236
  this.#POINT_LIST = new Array()
236
237
  }
237
238
  return res
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.28"
16
+ "version": "0.0.30"
17
17
  }