12345678910111213141516171819202122232425262728 |
- package routers
-
- import (
- "wsc-go/controllers"
-
- "github.com/astaxie/beego"
- "github.com/astaxie/beego/plugins/cors"
- )
-
- func init() {
- beego.InsertFilter("*", beego.BeforeRouter, cors.Allow(&cors.Options{
- // AllowAllOrigins: true,
- AllowOrigins: []string{"http://mall.kuyicloud.com", "http://mall.test.sgjyun.com"},
- AllowMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
- AllowHeaders: []string{"Origin", "Authorization", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"},
- ExposeHeaders: []string{"Content-Length", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"},
- AllowCredentials: true,
- }))
-
- beego.Router("/", &controllers.MainController{})
-
- controllers.VerifyUserLoginControllerRegistRouters()
- controllers.QiniuApiRegistRouters()
- controllers.OrgInfoApiRegistRouters()
- controllers.FxlinkApiRegistRouters()
-
- }
|