import httpRequest from '@/module/request/http-request.js'
import ipConfig from '@/config/ip.config.js'

const api = {
	appStackUpload: ipConfig.api_app + '/u/appStackUpload',
	appEventUpload: ipConfig.api_app + '/u/transferEventUpload',
	appConfig: ipConfig.api_app + '/u/gconfig',
	appLanguages: ipConfig.api_app + '/language/languages',
	appFbparams: ipConfig.api_app + '/fbclick/saveInfo',
	appUpdate: ipConfig.api_app + '/user/appVersion'
}

export const requestAppUpdate = (params) => {
	return httpRequest.post({
		url: api.appUpdate,
		data: params
	})
}
/**
 * app异常日志上报
 */
export const requestAppStackUpload = (params) => {
	return httpRequest.post({
		url: api.appStackUpload,
		data: params
	})
}

/**
 * app埋点上报
 */
export const requestAppEventUpload = (params) => {
	return httpRequest.post({
		url: api.appEventUpload,
		data: params
	})
}

/**
 * app全局配置
 */
export const requestAppConfig = (params) => {
	return httpRequest.post({
		url: api.appConfig,
		data: params
	})
}

/**
 * app国际化语言查询
 */
export const requestAppLanguages = (params) => {
	return httpRequest.get({
		url: api.appLanguages,
		data: params
	})	
}
/**
 * appfbparams
 */
export const requestAppFbparams = (params) => {
	return httpRequest.post({
		url: api.appFbparams,
		data: params
	})
}