正在显示
3 个修改的文件
包含
21 行增加
和
1 行删除
| @@ -279,6 +279,10 @@ var LogRequestData = func(ctx *context.Context) { | @@ -279,6 +279,10 @@ var LogRequestData = func(ctx *context.Context) { | ||
| 279 | } | 279 | } |
| 280 | } | 280 | } |
| 281 | 281 | ||
| 282 | +func CheckSignMiddleware(ctx *context.Context) { | ||
| 283 | + CheckSign(ctx) | ||
| 284 | +} | ||
| 285 | + | ||
| 282 | func (this *BaseController) Prepare() { | 286 | func (this *BaseController) Prepare() { |
| 283 | this.Ctx.ResponseWriter.Header().Set("Access-Control-Allow-Origin", "*") | 287 | this.Ctx.ResponseWriter.Header().Set("Access-Control-Allow-Origin", "*") |
| 284 | this.Ctx.ResponseWriter.Header().Set("Access-Control-Allow-Headers", "*") | 288 | this.Ctx.ResponseWriter.Header().Set("Access-Control-Allow-Headers", "*") |
| @@ -23,4 +23,20 @@ func init() { | @@ -23,4 +23,20 @@ func init() { | ||
| 23 | MethodParams: param.Make(), | 23 | MethodParams: param.Make(), |
| 24 | Params: nil}) | 24 | Params: nil}) |
| 25 | 25 | ||
| 26 | + beego.GlobalControllerRouter["opp/controllers:H5Controller"] = append(beego.GlobalControllerRouter["opp/controllers:H5Controller"], | ||
| 27 | + beego.ControllerComments{ | ||
| 28 | + Method: "ChanceExample", | ||
| 29 | + Router: `/chanceExample`, | ||
| 30 | + AllowHTTPMethods: []string{"post"}, | ||
| 31 | + MethodParams: param.Make(), | ||
| 32 | + Params: nil}) | ||
| 33 | + | ||
| 34 | + beego.GlobalControllerRouter["opp/controllers:H5Controller"] = append(beego.GlobalControllerRouter["opp/controllers:H5Controller"], | ||
| 35 | + beego.ControllerComments{ | ||
| 36 | + Method: "SysCommand", | ||
| 37 | + Router: `/sysCommand`, | ||
| 38 | + AllowHTTPMethods: []string{"post"}, | ||
| 39 | + MethodParams: param.Make(), | ||
| 40 | + Params: nil}) | ||
| 41 | + | ||
| 26 | } | 42 | } |
| @@ -35,7 +35,7 @@ func init() { | @@ -35,7 +35,7 @@ func init() { | ||
| 35 | beego.AddNamespace(nsV2) | 35 | beego.AddNamespace(nsV2) |
| 36 | 36 | ||
| 37 | nsH5 := beego.NewNamespace("h5", beego.NSBefore(controllers.LogRequestData), beego.NSBefore(controllers.AllowOption), beego.NSInclude(&controllers.H5Controller{})) | 37 | nsH5 := beego.NewNamespace("h5", beego.NSBefore(controllers.LogRequestData), beego.NSBefore(controllers.AllowOption), beego.NSInclude(&controllers.H5Controller{})) |
| 38 | - nsVod := beego.NewNamespace("vod", beego.NSBefore(controllers.LogRequestData), beego.NSBefore(controllers.AllowOption), beego.NSInclude(&v1.VodController{})) | 38 | + nsVod := beego.NewNamespace("vod", beego.NSBefore(controllers.LogRequestData), beego.NSBefore(controllers.AllowOption), beego.NSBefore(controllers.CheckSignMiddleware), beego.NSInclude(&v1.VodController{})) |
| 39 | beego.AddNamespace(nsH5) | 39 | beego.AddNamespace(nsH5) |
| 40 | beego.AddNamespace(nsVod) | 40 | beego.AddNamespace(nsVod) |
| 41 | //post 下载文件 | 41 | //post 下载文件 |
-
请 注册 或 登录 后发表评论