scrm-go

router.go 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. "SCRM/controllers/micro"
  18. "github.com/astaxie/beego/context"
  19. )
  20. func init() {
  21. beego.InsertFilter("*", beego.BeforeRouter, cors.Allow(&cors.Options{
  22. AllowOrigins: []string{"http://jk.kuyicloud.com", "http://localhost:8090","http://localhost:8091", "http://test1.sgjyun.com", "https://www.ucpaas.com","http://microweb.kuyicloud.com","http://jk.test.sgjyun.com"},
  23. AllowMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
  24. AllowHeaders: []string{"Origin", "Authorization", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"},
  25. ExposeHeaders: []string{"Content-Length", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"},
  26. AllowCredentials: true,
  27. }))
  28. beego.Get("/MP_verify_JiWyx0d2U4nzjGX5.txt", func(ctx *context.Context) {
  29. ctx.Output.Body([]byte("JiWyx0d2U4nzjGX5"))
  30. })
  31. global.RegisterRouters()
  32. admin_user.RegisterRouters()
  33. login.RegisterRouters()
  34. role.RegisterRouters()
  35. members.RegisterRouters()
  36. marketing_tool.RegisterRouters()
  37. article.RegisterRouters()
  38. mpwechat.RegisterRouters()
  39. sms.RegisterRouters()
  40. staff.RegisterRouters()
  41. kefu.RegisterRouters()
  42. site.RegisterRouters()
  43. micro.RegisterRouters()
  44. }