Skip to content

Commit 067accd

Browse files
committed
可配置请求发送超时时间
1 parent aaf8eaf commit 067accd

File tree

3 files changed

+114
-15
lines changed

3 files changed

+114
-15
lines changed

sensorsdata.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ if (!sa.para.openid_url) {
1414
sa.para.openid_url = sa.para.server_url.replace(/\/sa(\.gif){0,1}/, '/mp_login');
1515
}
1616

17+
if(typeof sa.para.send_timeout !== 'number'){
18+
sa.para.send_timeout = 1000;
19+
}
1720

1821
// 工具函数
1922

@@ -23,7 +26,7 @@ var ArrayProto = Array.prototype,
2326
slice = ArrayProto.slice,
2427
toString = ObjProto.toString,
2528
hasOwnProperty = ObjProto.hasOwnProperty,
26-
LIB_VERSION = '1.9.6',
29+
LIB_VERSION = '1.9.7',
2730
LIB_NAME = 'MiniProgram';
2831

2932
var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term';
@@ -1172,7 +1175,7 @@ sa.requestQueue.prototype.start = function () {
11721175
var me = this;
11731176
setTimeout(function () {
11741177
me.isEnd();
1175-
}, 600);
1178+
}, sa.para.send_timeout);
11761179
wx.request({
11771180
url: this.url,
11781181
method: 'GET',

0 commit comments

Comments
 (0)