You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
1.0 KiB

  1. package router
  2. import (
  3. "gin-vue-admin/controller/api"
  4. "gin-vue-admin/middleware"
  5. "github.com/gin-gonic/gin"
  6. )
  7. func InitMenuRouter(Router *gin.RouterGroup) (R gin.IRoutes) {
  8. MenuRouter := Router.Group("menu").Use(middleware.JWTAuth()).Use(middleware.CasbinHandler())
  9. {
  10. MenuRouter.POST("getMenu", api.GetMenu) //获取菜单树
  11. MenuRouter.POST("getMenuList", api.GetMenuList) // 分页获取基础menu列表
  12. MenuRouter.POST("addBaseMenu", api.AddBaseMenu) // 新增菜单
  13. MenuRouter.POST("getBaseMenuTree", api.GetBaseMenuTree) // 获取用户动态路由
  14. MenuRouter.POST("addMenuAuthority", api.AddMenuAuthority) // 增加menu和角色关联关系
  15. MenuRouter.POST("getMenuAuthority", api.GetMenuAuthority) // 获取指定角色menu
  16. MenuRouter.POST("deleteBaseMenu", api.DeleteBaseMenu) // 删除菜单
  17. MenuRouter.POST("updataBaseMenu", api.UpdataBaseMenu) // 更新菜单
  18. MenuRouter.POST("getBaseMenuById", api.GetBaseMenuById) //根据id获取菜单
  19. }
  20. return MenuRouter
  21. }