{"size": 761, "ext": "js", "max_stars_repo_path": "src/network/auth/menuCtrl.js", "max_stars_repo_name": "WuuG/fzu-engineering-practice", "max_stars_repo_stars_event_min_datetime": "2021-03-30T03:30:38.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-30T03:30:38.000Z", "max_issues_repo_path": "src/network/auth/menuCtrl.js", "max_issues_repo_name": "WuuG/fzu-engineering-practice", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/network/auth/menuCtrl.js", "max_forks_repo_name": "WuuG/fzu-engineering-practice", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 13.350877193, "max_line_length": 43, "alphanum_fraction": 0.5637319317}
import { request } from '../request';

const getMenus = () => {
	return request({
		url: 'menus',
	}, 'get')
}

const postMenu = (form) => {
	return request({
		url: 'menus',
		data: {
			...form
		}
	}, 'post')
}

const patchMenu = (form) => {
	return request({
		url: `menus/${form.id}`,
		data: {
			...form
		}
	}, 'patch')
}

const deleteMenu = (id) => {
	return request({
		url: `menus/${id}`,
	}, 'delete')
}

const getMymenus = () => {
	return request({
		url: `menus/my`,
	}, 'get')
}

/** 
 * 菜单排序
 * @pid 父节点id
 * @MenuArray 字节点所有菜单id的数组。
*/
const putMenuOrders = (pid, MenuArray) => {
	return request({
		url: `menus/${pid}/orders`,
		data: MenuArray
	}, 'put')
}
export {
	getMenus,
	postMenu,
	patchMenu,
	deleteMenu,
	getMymenus,
	putMenuOrders
}