router.go 1.9KB

1234567891011121314151617181920212223242526272829
  1. package routers
  2. import (
  3. "gdyb/controllers/sg"
  4. //"gdyb/controllers/sz"
  5. //"gdyb/controllers/sz"
  6. //"gdyb/controllers/sz"
  7. //admin_api "XT_New/controllers/admin_api_controllers"
  8. "github.com/astaxie/beego"
  9. "github.com/astaxie/beego/plugins/cors"
  10. )
  11. func init() {
  12. beego.InsertFilter("*", beego.BeforeRouter, cors.Allow(&cors.Options{
  13. // AllowAllOrigins: true,
  14. AllowOrigins: []string{"https://xt.kuyicloud.com", "http://localhost:9528", "http://localhost:9529", "http://localhost:9531", "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"},
  15. //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"},
  16. AllowMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
  17. AllowHeaders: []string{"Origin", "Authorization", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type", "X-XSRF-TOKEN", "Permission"},
  18. ExposeHeaders: []string{"Content-Length", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"},
  19. AllowCredentials: true,
  20. }))
  21. sg.HisManagerApiRegistRouters()
  22. sg.GdybRegistRouters()
  23. //sz.SZHisManagerApiRegistRouters()
  24. }