scrm-go

router.go 1.3KB

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