import {
	apiGET,
	apiPOST,
	apiDELETE,
	apiPUT
} from './server'
import config from '../config/config.js'

// export * from "./errorCode.js"


export const API_BASE = config.API_BASE
export const API_BASE_IMAGE_NET = config.API_BASE_IMAGE_NET
export const API_BASE_IMAGE = config.API_BASE_IMAGE

const HOME = 'home'


//********************首页 & 工作台********************
//首页
export const getArticleList = (params) => 
		apiGET(`${API_BASE}/user/v3/article/list`, params)
export const getBannerList = (params) => 
		apiGET(`${API_BASE}/user/v2/banner`, params)		
// 商品
export const getCartsList = (params) => 
		apiGET(`${API_BASE}/user/v3/carts/list`, params)
export const getStoreList = (params) =>
		apiGET(`${API_BASE}/user/store/list`, params)
export const getGoodsList = (params) =>
		apiGET(`${API_BASE}/user/v3/index`, params)
export const editnum = (params) =>
		apiPOST(`${API_BASE}/user/v3/carts/editnum`, params)
export const removeCarts = (params) =>
		apiPOST(`${API_BASE}/user/v3/carts/remove`, params)
export const createCarts = (params) =>
		apiPOST(`${API_BASE}/user/v3/carts/create`, params)
export const createList = (params) =>
		apiPOST(`${API_BASE}/user/v3/order/createlist`, params)

//用户
export const getUserInfo = (params) =>
		apiGET(`${API_BASE}/user/v2/userinfo`, params)

//用户微信获取openid登录
export const dakaLogin = (params) => 
	apiPOST(`${API_BASE}/api/mini-auth`, params)
//用户手机号密码登录
export const phoneLogin = (params) => 
	apiPOST(`${API_BASE}/api/pwdLogin`, params)
// 解析微信手机号，并绑定。
export const wxphoneNum = (params) => 
	apiPOST(`${API_BASE}/api/wxphoneNum`, params)	
// 更新头像
export const updateThumb = (params) => 
	apiPOST(`${API_BASE}/api/userInfo/updateThumb`, params)	
// 解析微信手机号，并绑定。	
	
//首页
export const getHomePage = (params) => 
		apiGET(`${API_BASE}/${MANGHE}/index`, params)
		
/**
* 文件上传地址
* @type {string}
*/
export const upload = `${API_BASE}/common/upload/file`