
import {
	httpUrlFormat,
	ajaxCarryAuthorization,ajaxSync
} from '@/utils/httpUtils.js'


import { ApiVersion,AppVersion } from '@/config/baseConfig.js'

const headerVersion = {
	'API-Version': ApiVersion(),
	'APP-Version':AppVersion()
}


const _flag = 'apiBaseUrl' // 请求的api空间

const apiUrl = {
	'reportHeartbeat': httpUrlFormat('/report/heartbeat', _flag),
	'reportClick': httpUrlFormat('/report/click', _flag),
	
	
}

//心跳埋点
export function reportHeartbeatApi(data) {
	const headerObj = {...headerVersion,'Content-Type': 'application/x-www-form-urlencoded'}
	return ajaxCarryAuthorization({
		header: headerObj,
		url: apiUrl.reportHeartbeat,
		method: 'POST',
		data: data
	})
}
//点击埋点
export function reportClickApi(data) {
	// const headerObj = {'Content-Type': 'application/x-www-form-urlencoded',...headerVersion}
	return ajaxCarryAuthorization({
		header: headerVersion,
		url: apiUrl.reportClick,
		method: 'POST',
		data: data
	})
}
