import request from '@/utils/request'

// 登录
export function login(data) {
	return request({
		url: '/api/user/login',
		method: 'post',
		data
	});
}
export function trade(data) {
	return request({
		url: '/api/user/trade',
		method: 'post',
		data
	});
}
// 注册
export function register(data) {
	return request({
		url: '/api/register',
		method: 'post',
		data
	});
}
// 验证码
export function verify(data) {
	// type=register为注册
	// type=login为登录
	return request({
		url: '/api/register/verify',
		method: 'post',
		data
	});
}

// 获取用户信息
export function getUserInfo(data) {
	return request({
		url: '/api/user/info',
		method: 'get',
		data
	});
}

// 短信登录
export function loginMobile(data) {
	return request({
		url: '/api/login/mobile',
		method: 'post',
		data
	});
}
// #ifdef APP-PLUS
// 微信授权登录
export function loginWx(data) {
	return request({
		url: '/api/wechat/appauth',
		method: 'get',
		data
	});
}
// #endif
//绑定手机号
export function bangding(data) {
	return request({
		url: '/api/binding',
		method: 'POST',
		data
	});
}
//绑定推荐人
export function bandgingSpead(data) {
	return request({
		url: '/api/user/addSpread',
		method: 'POST',
		data
	});
}
//绑定接点人
export function addParent(data) {
	return request({
		url: '/api/user/addParent',
		method: 'POST',
		data
	});
}