router.go 1.4 KB

12345678910111213141516171819202122232425262728
  1. package routers
  2. import (
  3. "ERP_project/controllers"
  4. errorlibs "git.baozhida.cn/ERP_libs/Error"
  5. beego "github.com/beego/beego/v2/server/web"
  6. )
  7. func init() {
  8. beego.ErrorController(&errorlibs.ErrorController{})
  9. //过滤器,拦截所有请求
  10. beego.InsertFilter("/*", beego.BeforeRouter, RBACFilter)
  11. ns := beego.NewNamespace("/Project",
  12. beego.NSRouter("/Finance_List", &controllers.ProjectController{}, "*:Project_Finance_List"), // 财务查看列表
  13. beego.NSRouter("/List", &controllers.ProjectController{}, "*:Project_List"), // 部门负责人查看列表
  14. beego.NSRouter("/User_list", &controllers.ProjectController{}, "*:Project_User_List"), // 用户列表
  15. beego.NSRouter("/Add", &controllers.ProjectController{}, "*:Project_Add"), // 添加项目
  16. beego.NSRouter("/Get", &controllers.ProjectController{}, "*:Project_Get"), // 项目详情
  17. beego.NSRouter("/Edit", &controllers.ProjectController{}, "*:Project_Edit"), // 修改项目
  18. beego.NSRouter("/Approval", &controllers.ProjectController{}, "*:Project_Approval"), // 项目审批
  19. beego.NSRouter("/Del", &controllers.ProjectController{}, "*:Project_Del"), // 删除项目
  20. beego.NSRouter("/Word", &controllers.ProjectController{}, "*:Project_Word"), // 删除项目
  21. )
  22. beego.Router("/User/List", &controllers.ProjectController{}, "*:User_List")
  23. beego.AddNamespace(ns)
  24. }