index.js 634 字节
Newer Older
study夏羽's avatar
study夏羽 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
const {
	createApi
} = require('./shared/index')

let reportDataReceiver, dataStatCron
module.exports = {
	//uni统计数据上报数据接收器初始化
	initReceiver: (options = {}) => {
		if(!reportDataReceiver) {
			reportDataReceiver = require('./stat/receiver')
		}
		options.clientType = options.clientType || __ctx__.PLATFORM
		return createApi(reportDataReceiver, options)
	},
	//uni统计数据统计模块初始化
	initStat: (options = {}) => {
		if(!dataStatCron) {
			dataStatCron = require('./stat/stat')
		}
		options.clientType = options.clientType || __ctx__.PLATFORM
		return createApi(dataStatCron, options)
	}
}