router.go 1.1 KB

1234567891011121314151617181920212223242526
  1. package routers
  2. import (
  3. "ERP_salary/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("/Salary",
  12. beego.NSRouter("/List", &controllers.SalaryController{}, "*:Salary_List"), // 薪资列表
  13. beego.NSRouter("/User_List", &controllers.SalaryController{}, "*:Salary_User_List"), // 我的薪资列表
  14. beego.NSRouter("/Get", &controllers.SalaryController{}, "*:Salary_Get"), // 获取薪资
  15. beego.NSRouter("/User_Get", &controllers.SalaryController{}, "*:Salary_User_Get"), // 我的薪资
  16. beego.NSRouter("/Post", &controllers.SalaryController{}, "*:Salary_Post"), // 添加薪资
  17. beego.NSRouter("/Send", &controllers.SalaryController{}, "*:Send_Salary"), // 发送薪资
  18. beego.NSRouter("/Excel", &controllers.SalaryController{}, "*:Salary_Excel"), // 导出excel
  19. )
  20. beego.AddNamespace(ns)
  21. }