/**
 * Copyright (c) 2013-Now http://aidex.vip All rights reserved.
 */
// 此处第二个参数vm，就是我们在页面使用的this，你可以通过vm获取vuex等操作
const install = (Vue, vm) => {
	
	// 参数配置对象
	const config = vm.vuex_config;
	
	// 将各个定义的接口名称，统一放进对象挂载到vm.$u.api(因为vm就是this，也即this.$u.api)下
	vm.$u.api = {
		//获取单位列表
		getUnits:(params = {}) => vm.$u.get(config.adminPath+'/property/enum-fetcher/enum-values/getUnit',params),
		getType:(params = {}) => vm.$u.get(config.adminPath+'/property/xcx/system/type/'+params),
		codesub: (params = {}) => vm.$u.get(config.adminPath+'/property/visitorManagement/useqr', params),
		uploadimg: (params = {}) => vm.$u.post(config.adminPath+'/resource/oss/upload', params),
		fksub: (params = {}) => vm.$u.post(config.adminPath+'/property/visitorManagement/add', params),
		login: (params = {}) => vm.$u.post(config.adminPath+'/auth/login', params),
		getUserInfo: (params = {}) => vm.$u.get(config.adminPath+'/system/user/profile', params)
	};
	
}

export default {
	install
}