scrm-go

router.go 1.2KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package routers
  2. import (
  3. "SCRM/controllers/admin_user"
  4. "SCRM/controllers/article"
  5. "SCRM/controllers/global"
  6. "SCRM/controllers/login"
  7. "SCRM/controllers/marketing_tool"
  8. "SCRM/controllers/members"
  9. "SCRM/controllers/mpwechat"
  10. "SCRM/controllers/role"
  11. "SCRM/controllers/kefu"
  12. "github.com/astaxie/beego"
  13. "github.com/astaxie/beego/plugins/cors"
  14. )
  15. func init() {
  16. beego.InsertFilter("*", beego.BeforeRouter, cors.Allow(&cors.Options{
  17. AllowOrigins: []string{"http://jk.kuyicloud.com", "http://localhost:8090", "http://test1.sgjyun.com", "https://www.ucpaas.com"},
  18. AllowMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
  19. AllowHeaders: []string{"Origin", "Authorization", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"},
  20. ExposeHeaders: []string{"Content-Length", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"},
  21. AllowCredentials: true,
  22. }))
  23. global.RegisterRouters()
  24. admin_user.RegisterRouters()
  25. login.RegisterRouters()
  26. role.RegisterRouters()
  27. members.RegisterRouters()
  28. marketing_tool.RegisterRouters()
  29. article.RegisterRouters()
  30. mpwechat.RegisterRouters()
  31. kefu.RegisterRouters()
  32. }