@@ -7212,7 +7212,7 @@ module.exports = function(module) {
72127212/*! exports provided: name, version, description, main, types, scripts, repository, keywords, author, license, bugs, homepage, dependencies, devDependencies, default */
72137213/***/ ( function ( module ) {
72147214
7215- module . exports = JSON . parse ( "{\"name\":\"cos-js-sdk-v5\",\"version\":\"1.4.7\",\"description\":\"JavaScript SDK for [腾讯云对象存储](https://cloud.tencent.com/product/cos)\",\"main\":\"dist/cos-js-sdk-v5.js\",\"types\":\"index.d.ts\",\"scripts\":{\"server\":\"node server/sts.js\",\"dev\":\"cross-env NODE_ENV=development webpack -w --mode=development\",\"build\":\"cross-env NODE_ENV=production webpack --mode=production\",\"cos-auth.min.js\":\"uglifyjs ./demo/common/cos-auth.js -o ./demo/common/cos-auth.min.js -c -m\"},\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/tencentyun/cos-js-sdk-v5.git\"},\"keywords\":[],\"author\":\"carsonxu\",\"license\":\"ISC\",\"bugs\":{\"url\":\"https://github.com/tencentyun/cos-js-sdk-v5/issues\"},\"homepage\":\"https://github.com/tencentyun/cos-js-sdk-v5#readme\",\"dependencies\":{\"@xmldom/xmldom\":\"^0.8.2\"},\"devDependencies\":{\"@babel/core\":\"7.17.9\",\"@babel/plugin-transform-runtime\":\"7.18.10\",\"@babel/preset-env\":\"7.16.11\",\"babel-loader\":\"8.2.5\",\"body-parser\":\"^1.18.3\",\"cross-env\":\"^5.2.0\",\"express\":\"^4.16.4\",\"qcloud-cos-sts\":\"^3.0.2\",\"request\":\"^2.87.0\",\"terser-webpack-plugin\":\"4.2.3\",\"webpack\":\"4.46.0\",\"webpack-cli\":\"4.10.0\"}}" ) ;
7215+ module . exports = JSON . parse ( "{\"name\":\"cos-js-sdk-v5\",\"version\":\"1.4.8\",\"description\":\"JavaScript SDK for [腾讯云对象存储](https://cloud.tencent.com/product/cos)\",\"main\":\"dist/cos-js-sdk-v5.js\",\"types\":\"index.d.ts\",\"scripts\":{\"server\":\"node server/sts.js\",\"dev\":\"cross-env NODE_ENV=development webpack -w --mode=development\",\"build\":\"cross-env NODE_ENV=production webpack --mode=production\",\"cos-auth.min.js\":\"uglifyjs ./demo/common/cos-auth.js -o ./demo/common/cos-auth.min.js -c -m\"},\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/tencentyun/cos-js-sdk-v5.git\"},\"keywords\":[],\"author\":\"carsonxu\",\"license\":\"ISC\",\"bugs\":{\"url\":\"https://github.com/tencentyun/cos-js-sdk-v5/issues\"},\"homepage\":\"https://github.com/tencentyun/cos-js-sdk-v5#readme\",\"dependencies\":{\"@xmldom/xmldom\":\"^0.8.2\"},\"devDependencies\":{\"@babel/core\":\"7.17.9\",\"@babel/plugin-transform-runtime\":\"7.18.10\",\"@babel/preset-env\":\"7.16.11\",\"babel-loader\":\"8.2.5\",\"body-parser\":\"^1.18.3\",\"cross-env\":\"^5.2.0\",\"express\":\"^4.16.4\",\"qcloud-cos-sts\":\"^3.0.2\",\"request\":\"^2.87.0\",\"terser-webpack-plugin\":\"4.2.3\",\"webpack\":\"4.46.0\",\"webpack-cli\":\"4.10.0\"}}" ) ;
72167216
72177217/***/ } ) ,
72187218
@@ -13726,7 +13726,8 @@ var Tracker = /*#__PURE__*/function () {
1372613726 deepTracker = opt . deepTracker ;
1372713727 var appid = bucket && bucket . substr ( bucket . lastIndexOf ( '-' ) + 1 ) || '' ;
1372813728 this . parent = parent ;
13729- this . deepTracker = deepTracker ; // 上报用到的字段
13729+ this . deepTracker = deepTracker ;
13730+ this . delay = delay ; // 上报用到的字段
1373013731
1373113732 this . params = {
1373213733 // 通用字段
@@ -13859,18 +13860,19 @@ var Tracker = /*#__PURE__*/function () {
1385913860 }
1386013861
1386113862 var eventCode = getEventCode ( this . params . name ) ;
13862- var formattedParams = formatParams ( this . params ) ;
13863+ var formattedParams = formatParams ( this . params ) ; // 兜底处理
1386313864
13864- if ( this . params . delay === 0 ) {
13865+ if ( ! this . beacon ) {
13866+ this . beacon = getBeacon ( this . delay || 5000 ) ;
13867+ }
13868+
13869+ if ( this . delay === 0 ) {
1386513870 // 实时上报
13866- this . beacon . onDirectUserAction ( eventCode , formattedParams ) ;
13871+ this . beacon && this . beacon . onDirectUserAction ( eventCode , formattedParams ) ;
1386713872 } else {
1386813873 // 周期性上报
13869- this . beacon . onUserAction ( eventCode , formattedParams ) ;
13870- } // 上报结束即销毁
13871-
13872-
13873- this . destroy ( ) ;
13874+ this . beacon && this . beacon . onUserAction ( eventCode , formattedParams ) ;
13875+ }
1387413876 } // 生成子实例,与父所属一个链路,可用于分块上传内部流程上报单个分块操作
1387513877
1387613878 } , {
@@ -13884,16 +13886,9 @@ var Tracker = /*#__PURE__*/function () {
1388413886 region : this . params . region ,
1388513887 fileKey : this . params . requestPath ,
1388613888 customId : this . params . customId ,
13887- delay : this . params . delay
13889+ delay : this . delay
1388813890 } ) ;
1388913891 return new Tracker ( subParams ) ;
13890- } // 链路结束后销毁实例
13891-
13892- } , {
13893- key : "destroy" ,
13894- value : function destroy ( ) {
13895- this . beacon = null ;
13896- this . params = { } ;
1389713892 }
1389813893 } ] ) ;
1389913894
0 commit comments