作者 yangfu

修改 1.vod接口验证签名

... ... @@ -279,6 +279,10 @@ var LogRequestData = func(ctx *context.Context) {
}
}
func CheckSignMiddleware(ctx *context.Context) {
CheckSign(ctx)
}
func (this *BaseController) Prepare() {
this.Ctx.ResponseWriter.Header().Set("Access-Control-Allow-Origin", "*")
this.Ctx.ResponseWriter.Header().Set("Access-Control-Allow-Headers", "*")
... ...
... ... @@ -23,4 +23,20 @@ func init() {
MethodParams: param.Make(),
Params: nil})
beego.GlobalControllerRouter["opp/controllers:H5Controller"] = append(beego.GlobalControllerRouter["opp/controllers:H5Controller"],
beego.ControllerComments{
Method: "ChanceExample",
Router: `/chanceExample`,
AllowHTTPMethods: []string{"post"},
MethodParams: param.Make(),
Params: nil})
beego.GlobalControllerRouter["opp/controllers:H5Controller"] = append(beego.GlobalControllerRouter["opp/controllers:H5Controller"],
beego.ControllerComments{
Method: "SysCommand",
Router: `/sysCommand`,
AllowHTTPMethods: []string{"post"},
MethodParams: param.Make(),
Params: nil})
}
... ...
... ... @@ -35,7 +35,7 @@ func init() {
beego.AddNamespace(nsV2)
nsH5 := beego.NewNamespace("h5", beego.NSBefore(controllers.LogRequestData), beego.NSBefore(controllers.AllowOption), beego.NSInclude(&controllers.H5Controller{}))
nsVod := beego.NewNamespace("vod", beego.NSBefore(controllers.LogRequestData), beego.NSBefore(controllers.AllowOption), beego.NSInclude(&v1.VodController{}))
nsVod := beego.NewNamespace("vod", beego.NSBefore(controllers.LogRequestData), beego.NSBefore(controllers.AllowOption), beego.NSBefore(controllers.CheckSignMiddleware), beego.NSInclude(&v1.VodController{}))
beego.AddNamespace(nsH5)
beego.AddNamespace(nsVod)
//post 下载文件
... ...