scrm-go

router.go 1.3KB

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