import http from "@/utils/request"

export default {
	account: {
		list: async function(data={}){
			return await http.get("v1/account/list", data);
		},
		add: async function(data={}){
			return await http.post("v1/account/add", data);
		},
		edit: async function(data={}){
			return await http.put("v1/account/edit", data);
		},
		del: async function(data={}){
			return await http.delete("v1/account/del", data);
		},
	},
	menu: {
		list: async function(data={}){
			return await http.get("v1/menu/list", data);
		},
		add: async function(data = {}){
			return await http.post("v1/menu/add", data);
		},
		edit: async function(data = {}){
			return await http.put("v1/menu/edit", data);
		},
		del: async function(data = {}){
			return await http.delete("v1/menu/del", data);
		}
	},
	dept: {
		list: async function(data={}){
			return await http.get("v1/dept/list", data);
		},
		add: async function(data={}){
			return await http.post("v1/dept/add", data);
		},
		edit: async function(data={}){
			return await http.put("v1/dept/edit", data);
		},
		del: async function(data={}){
			return await http.delete("v1/dept/del", data);
		}
	},
	role: {
		list: async function(data={}){
			return await http.get("v1/role/list", data);
		},
		add: async function(data={}){
			return await http.post("v1/role/add", data);
		},
		edit: async function(data={}){
			return await http.put("v1/role/edit", data);
		},
		del: async function(data={}){
			return await http.delete("v1/role/del", data);
		}
	},
	app: {
		list: async function(data={}){
			return await http.get("v1/app/list", data);
		},
		option: async function(data={}){
			return await http.get("v1/app/option", data);
		},
		add: async function(data={}){
			return await http.post("v1/app/add", data);
		},
		edit: async function(data={}){
			return await http.put("v1/app/edit", data);
		},
		del: async function(data={}){
			return await http.delete("v1/app/del", data);
		},
	}
}
