scrm-go

router.go 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. "SCRM/controllers/staff"
  15. )
  16. func init() {
  17. beego.InsertFilter("*", beego.BeforeRouter, cors.Allow(&cors.Options{
  18. AllowOrigins: []string{"http://jk.kuyicloud.com", "http://localhost:8090", "http://test1.sgjyun.com", "https://www.ucpaas.com"},
  19. AllowMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
  20. AllowHeaders: []string{"Origin", "Authorization", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"},
  21. ExposeHeaders: []string{"Content-Length", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"},
  22. AllowCredentials: true,
  23. }))
  24. global.RegisterRouters()
  25. admin_user.RegisterRouters()
  26. login.RegisterRouters()
  27. role.RegisterRouters()
  28. members.RegisterRouters()
  29. marketing_tool.RegisterRouters()
  30. article.RegisterRouters()
  31. mpwechat.RegisterRouters()
  32. staff.RegisterRouters()
  33. kefu.RegisterRouters()
  34. }