index.js 634 B

1234567891011121314151617181920212223
  1. const {
  2. createApi
  3. } = require('./shared/index')
  4. let reportDataReceiver, dataStatCron
  5. module.exports = {
  6. //uni统计数据上报数据接收器初始化
  7. initReceiver: (options = {}) => {
  8. if(!reportDataReceiver) {
  9. reportDataReceiver = require('./stat/receiver')
  10. }
  11. options.clientType = options.clientType || __ctx__.PLATFORM
  12. return createApi(reportDataReceiver, options)
  13. },
  14. //uni统计数据统计模块初始化
  15. initStat: (options = {}) => {
  16. if(!dataStatCron) {
  17. dataStatCron = require('./stat/stat')
  18. }
  19. options.clientType = options.clientType || __ctx__.PLATFORM
  20. return createApi(dataStatCron, options)
  21. }
  22. }