scrm-go

router.go 844B

12345678910111213141516171819202122232425
  1. package routers
  2. import (
  3. "SCRM/controllers/admin"
  4. "SCRM/controllers/global"
  5. "SCRM/controllers/login"
  6. "github.com/astaxie/beego"
  7. "github.com/astaxie/beego/plugins/cors"
  8. )
  9. func init() {
  10. beego.InsertFilter("*", beego.BeforeRouter, cors.Allow(&cors.Options{
  11. AllowOrigins: []string{"http://jk.kuyicloud.com", "http://localhost:9533", "http://test1.sgjyun.com", "https://www.ucpaas.com"},
  12. AllowMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
  13. AllowHeaders: []string{"Origin", "Authorization", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"},
  14. ExposeHeaders: []string{"Content-Length", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"},
  15. AllowCredentials: true,
  16. }))
  17. global.RegisterRouters()
  18. admin.RegisterRouters()
  19. login.RegisterRouters()
  20. }