router.go 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package routers
  2. import (
  3. "gdyb/controllers/ah"
  4. "gdyb/controllers/coordinate"
  5. "gdyb/controllers/hb"
  6. "gdyb/controllers/js"
  7. "gdyb/controllers/nm"
  8. "gdyb/controllers/sg"
  9. "gdyb/controllers/zh"
  10. //"gdyb/controllers/sz"
  11. //"gdyb/controllers/sz"
  12. //admin_api "XT_New/controllers/admin_api_controllers"
  13. "github.com/astaxie/beego"
  14. "github.com/astaxie/beego/plugins/cors"
  15. )
  16. func init() {
  17. beego.InsertFilter("*", beego.BeforeRouter, cors.Allow(&cors.Options{
  18. //AllowAllOrigins: true,
  19. AllowOrigins: []string{"https://xt.kuyicloud.com", "http://localhost:9528", "http://localhost:9529", "http://localhost:9532", "http://localhost:9531", "http://localhost:9532", "http://xt.test.shengws.com", "http://new_mobile.test.sgjyun.com", "https://xt.test.shengws.com", "http://xt.test.sgjyun.com", "https://xt.test.sgjyun.com", "http://localhost:8081", "http://localhost:8082", "https://pad.kuyicloud.com", "http://pad.kuyicloud.com", "http://pad.test.sgjyun.com", "https://pad.test.sgjyun.com", "http://admin.xt.test.sgjyun.com", "http://admin.xt.kuyicloud.com", "http://mobile.sgjyun.com", "http://mobile.kuyicloud.com"},
  20. //AllowOrigins: []string{"https://xt.kuyicloud.com", "http://localhost:9528", "http://xt.test.shengws.com","https://xt.test.shengws.com", "http://xt.test.sgjyun.com","https://xt.test.sgjyun.com", "http://localhost:8081", "http://localhost:8082", "https://pad.kuyicloud.com", "http://pad.kuyicloud.com", "http://pad.test.sgjyun.com","https://pad.test.sgjyun.com", "http://admin.xt.test.sgjyun.com", "http://admin.xt.kuyicloud.com","http://mobile.sgjyun.com","http://mobile.kuyicloud.com"},
  21. AllowMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
  22. AllowHeaders: []string{"Origin", "Authorization", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type", "X-XSRF-TOKEN", "Permission", "Content-Security-Policy"},
  23. ExposeHeaders: []string{"Content-Length", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"},
  24. AllowCredentials: true,
  25. }))
  26. sg.HisManagerApiRegistRouters()
  27. sg.GdybRegistRouters()
  28. sg.FaPiaoApiRegistRouters()
  29. hb.HbybRegistRouters()
  30. //sz.SZHisManagerApiRegistRouters()
  31. zh.ZHHisManagerApiRegistRouters()
  32. js.JSybRegistRouters()
  33. nm.NmybRegistRouters()
  34. ah.AHybRegistRouters()
  35. coordinate.CoordinateRcegistRouters()
  36. coordinate.CoordinatenetRcegistRouters()
  37. }