Ai
1 Star 0 Fork 0

ReVueMonitor/自定义插件Demo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
revueMonitorReply.js 1.23 KB
一键复制 编辑 原始数据 按行查看 历史
imAei 提交于 2022-08-18 22:59 +08:00 . add revueMonitorReply.js.
/*
* @Author: aei
* @Date: 2022-08-18 21:44:01
* @LastEditors: aei
* @LastEditTime: 2022-08-18 22:54:57
* @Description:
*/
import {record} from 'rrweb'
// import RrwebPlayer from 'rrweb-player';
// import 'rrweb-player/dist/style.css';
let myEvents = [];
let errorIds= []
record({
emit(event, isCheckout) {
if(isCheckout) {
errorIds.forEach(id => {
fetch(new Request('', {
method: 'post',
headers: {'Content-Type': 'application/json;charset=utf-8'},
body: JSON.stringify({
id,
record: myEvents
})
})).then(null, (err) => {
console.error(err)
})
})
errorIds = []
myEvents = []
}
myEvents.push(event);
},
checkoutEveryNms: 5 * 60 * 1000,
},);
export default {
jsError(id) {
errorIds.push(id)
}
}
// export const replay = function() {
// replayer = new RrwebPlayer({
// target: document.getElementById('replayer'),
// props: {
// events: errorRecords,
// width: 500,
// height: 500,
// showWarning: false,
// tags: {
// error: 'red'
// }
// }
// })
// replayer.play();
// }
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/re-vue-monitor/custom-plug-in-demo.git
git@gitee.com:re-vue-monitor/custom-plug-in-demo.git
re-vue-monitor
custom-plug-in-demo
自定义插件Demo
master

搜索帮助