newhope-wxobs
v1.0.2
Published
微信小程序监控平台
Downloads
62
Readme
小程序使用参考文档
https://dev.weixin.qq.com/docs/analysis/sdk/sdk.html
async onLaunch() { // const wxObsObj = await wxobs.setup({ maskMode: 'no-mask', // 网络请求采集 shouldCaptureNetwork: (INetworkRequestInfo)=> INetworkRequestInfo,
onReport: (data)=>{
console.log(data, '上报数据时的回调');
},
errorCallback: (err)=>{
console.log(err, '采集器内部发生错误时的回调');
wxobs.event('wxobsStart', {
exception: new Date().getTime(),
status: '采集器内部发生错误时的回调'
});
}
}) }
封装原因
1.处理参数不能有英文逗号,对有英文逗号的字符串进行encodeURIComponent编码,使用时使用decodeURIComponent进行解码 2.处理属性值长度不能超过255,超过做字符串截取处理,并向事件参数里面增加
npm设置官方源
npm config set registry https://registry.npmjs.org
npm设置淘宝源
npm config set registry https://registry.npmmirror.com