import config from "@/config"
import http from "@/utils/request"

export default {
	list: {
		url: `${config.API_URL}auth/user/index`,
		name: "获得用户列表",
		get: async function(params){
			return await http.get(this.url, params);
		}
	},
	add: {
		url: `${config.API_URL}auth/user/add`,
		name: "添加用户",
		post: async function(params){
			return await http.post(this.url, params);
		}
	},
	edit: {
		url: `${config.API_URL}auth/user/edit`,
		name: "编辑用户",
		post: async function(params){
			return await http.post(this.url, params);
		}
	},
	uppasswd:{
		url: `${config.API_URL}auth/user/passwd`,
		name: "修改密码",
		post: async function(params){
			return await http.post(this.url, params);
		}
	},
	uprole: {
		url: `${config.API_URL}auth/user/auth`,
		name: "编辑用户",
		post: async function(params){
			return await http.post(this.url, params);
		}
	},
	role: {
		list: {
			url: `${config.API_URL}auth/role/index`,
			name: "获得角色列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		edit: {
			url: `${config.API_URL}auth/role/edit`,
			name: "编辑角色",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		auth: {
			url: `${config.API_URL}auth/role/auth`,
			name: "编辑角色",
			post: async function(params){
				return await http.post(this.url, params);
			}
		}
	},
	department: {
		list: {
			url: `${config.API_URL}auth/department/index`,
			name: "获得部门列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		edit: {
			url: `${config.API_URL}auth/department/edit`,
			name: "编辑部门",
			post: async function(params){
				return await http.post(this.url, params);
			}
		}
	},
	userinfo:{
		url: `${config.API_URL}auth/user/info`,
		name: "获得用户信息",
		get: async function(params){
			return await http.get(this.url, params);
		}
	}
}