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/api/v1"
  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", v1.GetMenu) // 获取菜单树
  11. MenuRouter.POST("getMenuList", v1.GetMenuList) // 分页获取基础menu列表
  12. MenuRouter.POST("addBaseMenu", v1.AddBaseMenu) // 新增菜单
  13. MenuRouter.POST("getBaseMenuTree", v1.GetBaseMenuTree) // 获取用户动态路由
  14. MenuRouter.POST("addMenuAuthority", v1.AddMenuAuthority) // 增加menu和角色关联关系
  15. MenuRouter.POST("getMenuAuthority", v1.GetMenuAuthority) // 获取指定角色menu
  16. MenuRouter.POST("deleteBaseMenu", v1.DeleteBaseMenu) // 删除菜单
  17. MenuRouter.POST("updateBaseMenu", v1.UpdateBaseMenu) // 更新菜单
  18. MenuRouter.POST("getBaseMenuById", v1.GetBaseMenuById) // 根据id获取菜单
  19. }
  20. return MenuRouter
  21. }