分销商城(微商城)接口项目

router.go 915B

12345678910111213141516171819202122232425262728
  1. package routers
  2. import (
  3. "wsc-go/controllers"
  4. "github.com/astaxie/beego"
  5. "github.com/astaxie/beego/plugins/cors"
  6. )
  7. func init() {
  8. beego.InsertFilter("*", beego.BeforeRouter, cors.Allow(&cors.Options{
  9. // AllowAllOrigins: true,
  10. AllowOrigins: []string{"http://mall.kuyicloud.com", "http://mall.test.sgjyun.com"},
  11. AllowMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
  12. AllowHeaders: []string{"Origin", "Authorization", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"},
  13. ExposeHeaders: []string{"Content-Length", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"},
  14. AllowCredentials: true,
  15. }))
  16. beego.Router("/", &controllers.MainController{})
  17. controllers.VerifyUserLoginControllerRegistRouters()
  18. controllers.QiniuApiRegistRouters()
  19. controllers.OrgInfoApiRegistRouters()
  20. controllers.FxlinkApiRegistRouters()
  21. }