router.go 664 B

123456789101112131415161718192021222324252627282930
  1. // Package routers
  2. // @APIVersion 1.0.0
  3. // @Title 接入统一身份认证demo
  4. // @Description 接入统一身份认证demo
  5. // @TermsOfServiceUrl http://127.0.0.1:8083/swagger/swagger.json
  6. package routers
  7. import (
  8. "Medical_ERP/controllers"
  9. "Medical_ERP/middleware"
  10. beego "github.com/beego/beego/v2/server/web"
  11. )
  12. func init() {
  13. //跨域
  14. middleware.CorsMiddle()
  15. //授权登录中间件
  16. middleware.AuthMiddle()
  17. //日志中间件
  18. middleware.LogMiddle()
  19. // 更新权限
  20. beego.Router("/api/role-api", &controllers.RoleApi{}, "*:UpdateRoleApi")
  21. // 文件上传
  22. beego.Router("/api/UpFileToken", &controllers.UpFileController{}, "*:ConfigUpFileToken")
  23. }