import configService from '@/common/config.service.js';

const install = (Vue, vm) => {
	vm.$api.wxLogin = async (params = {}) => await vm.$u.get('/wxUser/wxPhoneLogin', params);// 手机号一键登录
	vm.$api.editUserMessage = async (params = {}) => await vm.$u.put('/wxUser', params);// 修改个人资料
	vm.$api.getBanner = async (params = {}) => await vm.$u.get('/cpBanner/all', params);// 获取轮播图
	vm.$api.addMessage = async (params = {}) => await vm.$u.post('/cpMessage', params);// 添加留言
	
	// 文章部分
	vm.$api.getAllModule = async (params = {}) => await vm.$u.get('/cpModule/all', params);// 获取全部模块
	vm.$api.getSingleModule = async (id) => await vm.$u.get(`/cpModule/${id}`);// 获取单个模块
	vm.$api.getLabel = async (moduleid) => await vm.$u.get(`/cpLabel/moduleid/${moduleid}`);// 获取模块下的标签
	vm.$api.getArticleList = async (params = {}) => await vm.$u.get('/cpArticle', params);// 分页获取文章列表
	vm.$api.getSingleArticle = async (id) => await vm.$u.get(`/cpArticle/${id}`);// 获取单个文章
	
}

export default {
	install
}
