import request from "./request.js"


//获取基础信息
export function getIndex(data) {
	return request({
		url: '/api/index/index',
		method: 'get',
		data
	});
}

//获取验证码
export function getSpace(data) {
	return request({
		url: '/api/index/space',
		method: 'get',
		data
	});
}

//校验
export function spaceCheck(data) {
	return request({
		url: '/api/index/space_check',
		method: 'post',
		params: data
	});
}
 
//获取快递信息、
export function getExpressDelivery(data) {
	//index/getExpressDelivery
	return request({
		url: '/api/index/getExpressDelivery',
		method: 'get',
		params:data
	});
}

// 获取验证码列表
export function getRegList(data) {
	return request({
		url: '/api/index',
		method: 'get',
		data
	});
}

//登录
export function login(data = {}) {
	return request({
		url: '/api/user/login',
		method: 'post',
		data
	});
}

//购买注册码
export function createCode(data = {}) {
	return request({
		url: '/api/Agent/create_code',
		method: 'post',
		data
	});
}

//设置交易密码
export function setTransaction(data={}) {
	return request({
		url: '/api/user/transaction',
		method: 'post',
		data
	});
}

//注册码列表
export function getCodeList(data={}) {
	return request({
		url: '/api/Agent/code',
		method: 'get',
		params:data
	});
}

//注册
export function reg(data) {
	return request({
		url: '/api/user/register',
		method: 'post',
		data
	});
}

//创建token
export function createToken(data) {
	return request({
		url: '/api/user/create_token',
		method: 'post',
		data
	});
}

//获取token列表
export function getTokenList(data) {
	return request({
		url: '/api/user/get_token_list',
		method: 'get',
		params:data
	});
}

export function getUserInfo(data) {
	return request({
		url: '/api/user/userinfo',
		method: 'get',
		params:data
	});
}

export function dataCount(data) {
	return request({
		url: '/api/agent/data_count',
		method: 'get',
		params:data
	});
}
//代理订单
export function getOrderList(data) {
	return request({
		url: '/api/agent/order',
		method: 'get',
		params:data
	});
}

export function tlement (data) {
  return request({
    url: '/api/agent/tlement',
    method: 'get',
    data
  })
}
//获取地址信息
export function getAddressList(data) {
	return request({
		url: '/api/agent/address',
		method: 'get',
		params:data
	});
}

export function auth_tlement(data) {
  return request({
  	url: '/api/agent/auth_tlement',
  	method: 'post',
  	data
  });
}

export function user(data) {
  return request({
  	url: '/api/agent/user',
  	method: 'get',
  	params:data
  });
}