router.go 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. package routers
  2. import (
  3. "gdyb/controllers/coordinate"
  4. "gdyb/controllers/hb"
  5. "gdyb/controllers/js"
  6. "gdyb/controllers/nm"
  7. "gdyb/controllers/sg"
  8. "gdyb/controllers/zh"
  9. //"gdyb/controllers/sz"
  10. //"gdyb/controllers/sz"
  11. //admin_api "XT_New/controllers/admin_api_controllers"
  12. "github.com/astaxie/beego"
  13. "github.com/astaxie/beego/plugins/cors"
  14. )
  15. func init() {
  16. beego.InsertFilter("*", beego.BeforeRouter, cors.Allow(&cors.Options{
  17. //AllowAllOrigins: true,
  18. 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"},
  19. //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"},
  20. AllowMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
  21. AllowHeaders: []string{"Origin", "Authorization", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type", "X-XSRF-TOKEN", "Permission", "Content-Security-Policy"},
  22. ExposeHeaders: []string{"Content-Length", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"},
  23. AllowCredentials: true,
  24. }))
  25. sg.HisManagerApiRegistRouters()
  26. sg.GdybRegistRouters()
  27. hb.HbybRegistRouters()
  28. //sz.SZHisManagerApiRegistRouters()
  29. zh.ZHHisManagerApiRegistRouters()
  30. js.JSybRegistRouters()
  31. nm.NmybRegistRouters()
  32. coordinate.CoordinateRegistRouters()
  33. }