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 = {
	'signInInfo': httpUrlFormat('/user/sign/in/info', _flag),//用户签到信息
	'signIn': httpUrlFormat('/user/sign/in', _flag),//用户签到
	'taskList': httpUrlFormat('/task/list', _flag),//任务列表
	
	
}

export function signInInfo(data) {
	return ajaxCarryAuthorization({
		header: headerVersion,
		url: apiUrl.signInInfo,
		method: 'GET',
		data: data
	})
}
export function signIn(data) {
	const headerObj = {...headerVersion,'Content-Type': 'application/x-www-form-urlencoded'}
	return ajaxCarryAuthorization({
		header: headerObj,
		url: apiUrl.signIn,
		method: 'POST',
		data
	})
}
export function taskListApi(data) {
	return ajaxCarryAuthorization({
		header: headerVersion,
		url: apiUrl.taskList,
		method: 'GET',
		data: data
	})
}
export function taskReceive(taskId) {
	return ajaxCarryAuthorization({
		header: headerVersion,
		url: httpUrlFormat(`/task/receive/${taskId}`, _flag),
		method: 'POST',
	})
}