router.go 789 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * @desc:后台路由
  3. * @company:云南奇讯科技有限公司
  4. * @Author: yixiaohu
  5. * @Date: 2022/2/18 17:34
  6. */
  7. package router
  8. import (
  9. "github.com/gogf/gf/v2/net/ghttp"
  10. "github.com/gogf/gf/v2/os/gctx"
  11. commonService "github.com/tiger1103/gfast/v3/internal/app/common/service"
  12. "github.com/tiger1103/gfast/v3/internal/app/system/controller"
  13. "github.com/tiger1103/gfast/v3/internal/app/system/service"
  14. )
  15. func BindController(group *ghttp.RouterGroup) {
  16. group.Group("/system", func(group *ghttp.RouterGroup) {
  17. group.Middleware(commonService.Middleware().MiddlewareCORS)
  18. //登录验证拦截
  19. service.GfToken(gctx.New()).Middleware(group)
  20. //context拦截器
  21. group.Middleware(service.Middleware().Ctx, service.Middleware().Auth)
  22. group.Bind(
  23. controller.User,
  24. )
  25. })
  26. }