1.0.2 • Published 3 years ago
live-fe-report-test v1.0.2
live-report-fe
项目结构
├── README.md
├── dist // 编译产出文件
│ ├── index.js
│ └── index.js.map
├── index.js // 上报库主入口
├── modules // 上报模块
│ ├── base.js
│ ├── commonReport.js
│ └── videoReport.js
├── package.json
└── utils // 工具类
├── axios.js
└── getRequestUrl.js
业务侧如何使用
import { VideoReport, CommonReport } from '../assets/js/index';
// 通用上报字段
const commonInfo = {
app_id: 'appAKLWLitn7978', // 店铺id
alive_id: 'l_5fb6638be4b0231ba887945d', // 直播间ID,如没有就传'default'
user_agent: window.navigator.userAgent, // UA
user_id: 'u_5e5395c0c21a7_fHcn9Z4b21', // 用户ID,如没有就传'default'
report_type: 2, // 上报类型: 1-卡顿;2-操作异常;3-页面异常
client: 1, // 终端类型:1-H5 2-H5兼容PC 3-PC端讲师录制段 4-小程序 5-IOS APP推流端 6-android APP推流端; 7-商家助手推流小程序 8-B端管理台,
referer: window.location.href,
};
this.common_report = new CommonReport(commonInfo);
const params = {}; // 其他上报参数,会统一装到 params 这个对象中传过去
this.common_report.send(params); // 发送上报
手动编译
npm run build