import http from './index.js';

// 获取图形验证码
export const getCaptcha = (params) => http.get('/captcha', {params})

// 发送短信验证码
export const sendSmsCaptcha = (params) => http.post('/open/sendSmsCaptcha', {params})

// 支付宝授权码换取userId
export const getAuthCode = (data) => http.post('/open/login-alipay/getAuthCode', data)

// 获取支付宝手机号码
export const getPhoneNumber = (data, config) => http.post('/shop/payment/getPhoneNumber', data, config)

// 支付宝登录
export const alipayLogin = (data) => http.post('/login-alipay/login', data)

// 支付宝用户注册
export const register = (data) => http.post('/login-alipay/register', data)

// 游客登录
export const login = (data) =>  http.post('/login', data)

export default {
	getCaptcha,
	sendSmsCaptcha,
	getAuthCode,
	getPhoneNumber,
	alipayLogin,
	login
}
