Fix issue #4528
This commit is contained in:
parent
f2b98d5ed4
commit
8c05252378
@ -44,7 +44,8 @@ var (
|
|||||||
// The hookfuncs will run in beego.Run()
|
// The hookfuncs will run in beego.Run()
|
||||||
// such as initiating session , starting middleware , building template, starting admin control and so on.
|
// such as initiating session , starting middleware , building template, starting admin control and so on.
|
||||||
func AddAPPStartHook(hf ...hookfunc) {
|
func AddAPPStartHook(hf ...hookfunc) {
|
||||||
for _, f := range hf {
|
for i := 0; i < len(hf); i++ {
|
||||||
|
f := hf[i]
|
||||||
web.AddAPPStartHook(func() error {
|
web.AddAPPStartHook(func() error {
|
||||||
return f()
|
return f()
|
||||||
})
|
})
|
||||||
|
|||||||
@ -39,7 +39,8 @@ func NewNamespace(prefix string, params ...LinkNamespace) *Namespace {
|
|||||||
|
|
||||||
func oldToNewLinkNs(params []LinkNamespace) []web.LinkNamespace {
|
func oldToNewLinkNs(params []LinkNamespace) []web.LinkNamespace {
|
||||||
nps := make([]web.LinkNamespace, 0, len(params))
|
nps := make([]web.LinkNamespace, 0, len(params))
|
||||||
for _, p := range params {
|
for i := 0; i < len(params); i++ {
|
||||||
|
p := params[i]
|
||||||
nps = append(nps, func(namespace *web.Namespace) {
|
nps = append(nps, func(namespace *web.Namespace) {
|
||||||
p((*Namespace)(namespace))
|
p((*Namespace)(namespace))
|
||||||
})
|
})
|
||||||
@ -82,7 +83,8 @@ func (n *Namespace) Filter(action string, filter ...FilterFunc) *Namespace {
|
|||||||
|
|
||||||
func oldToNewFilter(filter []FilterFunc) []web.FilterFunc {
|
func oldToNewFilter(filter []FilterFunc) []web.FilterFunc {
|
||||||
nfs := make([]web.FilterFunc, 0, len(filter))
|
nfs := make([]web.FilterFunc, 0, len(filter))
|
||||||
for _, f := range filter {
|
for i := 0; i < len(filter); i++ {
|
||||||
|
f := filter[i]
|
||||||
nfs = append(nfs, func(ctx *context.Context) {
|
nfs = append(nfs, func(ctx *context.Context) {
|
||||||
f((*adtContext.Context)(ctx))
|
f((*adtContext.Context)(ctx))
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user