import request from "/utils/request.js";
export function useLoginApi() { 
	return {
		//获取code img
		getCode: () => {
			return request.request({
				url: '/Login/Captcha',
				method: 'get',
			});
		},
		//登录
		Login: (data) => {
			return request.request({
				url: '/ClientCustomer/Login',
				method: 'post',
				data,
			});
		},
		Register: (data) => {
			return request.request({
				url: '/ClientCustomer/Register',
				method: 'post',
				data,
			});
		},
		EmailVerify: (data) => {
			return request.request({
				url: '/ClientCustomer/EmailVerify',
				method: 'post',
				data,
			});
		},
		ForgotPassword: (data) => {
			return request.request({
				url: '/ClientCustomer/ForgotPassword',
				method: 'post',
				data,
				headers: {
				    "Content-Type": "application/json; charset=utf-8",
				          }
			});
		},
		UpdateUserInfo: (data) => {
			return request.request({
				url: '/ClientCustomer/UpdateUserInfo',
				method: 'post',
				data,
			});
		},
		// 微信登录
		AuthorizedLogin: (data) => {
			return request.request({
				url:'/ClientCustomer/AuthorizedLogin',
				method:'post',
				data,
			})
		},
		// 通过用户授权的code去获取手机号码
		GetPhoneNumber: (data) => {
			return request.request({
				url:`/ClientCustomer/GetPhoneNumber`,
				method:'get',
				params:{
					...data,
					isUpdate:true
				},
			})
		},
		// 通过用户授权的code去获取手机号码
		GetPhoneNumberNoUpdate: (data) => {
			return request.request({
				url:`/ClientCustomer/GetPhoneNumber?code=${data}`,
				method:'get',
				data,
			})
		},
		// 获取用户信息
		GetUserInfo:() =>{
			return request.request({
				url:`/ClientCustomer/GetUserInfo`,
				method:'get',
			})
		},
		// 更新用户信息
		EditUserInfo: (data) => {
			return request.request({
				url: '/ClientCustomer/EditUserInfo',
				method: 'post',
				data,
			});
		},
		// 从主题二维码来的
		GetActivitiesCode: (data) => {
			return request.request({
				url: '/ClientCustomer/GetActivitiesCode',
				method: 'post',
				data,
			});
		},
		// 获取openId
		GetOpenId: (data) => {
			return request.request({
				url:'/ClientCustomer/GetOpenId',
				method:'post',
				data,
			})
		},
		// 获取积分豆
		GetCustomerPoint: () => {
			return request.request({
				url: '/ClientCustomer/GetCustomerPoint',
				method: 'get',
			});
		},
		// 兑换奖品
		CustomerExchangeGift: (data) => {
			return request.request({
				url: '/ClientPoint/CustomerExchangeGift',
				method: 'post',
				data,
			});
		},
		GetGiftInfo: (data) => {
			return request.request({
				url: '/ClientPoint/GetGiftInfo',
				method: 'post',
				data,
			});
		},
		GetGiftList: () => {
			return request.request({
				url: '/ClientPoint/GetGiftList',
				method: 'get',
			});
		},
		GetCustomerExchangeGift: (data) => {
			return request.request({
				url: '/ClientPoint/GetCustomerExchangeGift',
				method: 'get',
				data,
			});
		},
		GetCustomerList: (data) => {
			return request.request({
				url: '/Customer/GetCustomerList',
				method: 'get',
				data,
			});
		},
		ShunFengLogin: (data) => {
			return request.request({
				url: '/ShunFeng/ShunFengLogin',
				method: 'post',
				data,
			});
		}

	};
}