import {request} from '@/utils/request.js'

// 注册
export function register(data) {
	return request({
		url: '/zswl-cloud-bdb/user/addUser',
		method:'post',
		data
	})
}

// 获取短信验证码
export function sendVerifyCode(data) {
	return request({
		url: '/zswl-cloud-bdb/smsTemplate/sendVerifyCode',
		method:'post',
		data
	})
}

// 实名认证
export function auth(data) {
	return request({
		url: '/zswl-cloud-bdb/user/auth',
		method:'post',
		data
	})
}


// 刷新token
export function refreshToken(data) {
	return request({
		url: '/zswl-cloud-bdb/user/refreshToken',
		data
	})
}

// 获取登录token
export function getLoginToken(data) {
	return request({
		url: '/zswl-cloud-bdb/user/getLoginToken',
		data
	})
}

// 微信登录
export function wechatLogin(data) {
	return request({
		url: '/zswl-cloud-bdb/user/wechatLogin',
		method:'post',
		data
	})
}

// 验证码登录
export function validLogin(data) {
	return request({
		url: '/zswl-cloud-bdb/user/validLogin',
		method:'post',
		data
	})
}

// 获取手机号
export function getPhoneNum(data) {
	return request({
		url: '/zswl-cloud-bdb/user/getPhoneNumGd',
		data
	})
}

// 用户详情
export function getUserDetail(data) {
	return request({
		url: '/zswl-cloud-bdb/user/detail',
		data
	})
}

// 通知列表
export function getNotification(data) {
	return request({
		url: '/zswl-cloud-bdb/user/search',
		data
	})
}

// 更改套餐
export function updateLevel(data) {
	return request({
		url: '/zswl-cloud-bdb/user/updateLevel',
		method:'post',
		data
	})
}

// 修改昵称
export function updateNickname(data) {
	return request({
		url: '/zswl-cloud-bdb/user/updateNickname',
		method:'post',
		data
	})
}

// // 上传头像
// export function uploadImg(data) {
// 	return request({
// 		url: '/user/uploadImg',
// 		method:'post',
// 		data
// 	})
// }

// 获取打开小程序url
export function getScheme(data) {
	return request({
		url: '/zswl-cloud-bdb/user/generateScheme',
		data
	})
}

// // 获取oss上传
// export function uploadImg(data) {
// 	return request({
// 		url: '/OSS/oss/getSign',
// 		data
// 	})
// }

// 获取oss上传
export function uploadImg(data) {
	return request({
		url: '/zswl-cloud-bdb/user/requestUploadImg',
		method:'post',
		data
	})
}

// 通知服务端上传结果
export function finishUploadImg(data) {
	return request({
		url: '/zswl-cloud-bdb/user/finishUploadImg',
		method:'post',
		data
	})
}


// 上传正常图片
export function finishUpload(data) {
	return request({
		url: '/zswl-cloud-bdb/user/finishUploadImg?type=2',
		method:'post',
		data
	})
}


// 获取金刚区
export function getMenu(data) {
	return request({
		url: '/zswl-cloud-shop/menu/list',
		data
	})
}

// 获取广告位
export function getAdv(data) {
	return request({
		url: '/zswl-cloud-shop/advertsInfo/search',
		data
	})
}

//获取邀请码
export function getInviteCode(data) {
	return request({
		url: '/zswl-cloud-shop/employeeShopRelation/getShopList',
		data
	})
}

//banner列表
export function getBanner(data) {
	return request({
		url: '/zswl-cloud-shop/banner/list',
		data
	})
}

//搜索记录
export function getSearchHistory(data) {
	return request({
		url: '/zswl-cloud-bdb/user/getSearchHistory',
		data
	})
}

//删除搜索记录
export function delSearchHistory(data) {
	return request({
		url: '/zswl-cloud-bdb/user/delSearchHistory',
		data
	})
}

//保存搜索记录
export function saveSearchHistory(data) {
	return request({
		url: '/zswl-cloud-bdb/user/saveSearchHistory',
		data
	})
}


//获取商品类型字典
export function getGoodsTypeObj(data) {
	return request({
		url: '/zswl-cloud-shop/goodsCoupon/getMsg',
		data
	})
}
