mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-12-08 09:16:08 +08:00
发布v2.11.5版本,更新内容请查看:https://github.com/bufanyun/hotgo/blob/v2.0/docs/guide-zh-CN/start-update-log.md
This commit is contained in:
@@ -63,12 +63,18 @@ func (s *sMiddleware) Ctx(r *ghttp.Request) {
|
||||
r.SetCtx(ctx)
|
||||
}
|
||||
|
||||
data := g.Map{
|
||||
"request.body": gjson.New(r.GetBodyString()),
|
||||
}
|
||||
|
||||
contexts.Init(r, &model.Context{
|
||||
Data: make(g.Map),
|
||||
Data: data,
|
||||
Module: getModule(r.URL.Path),
|
||||
})
|
||||
|
||||
contexts.SetData(r.Context(), "request.body", gjson.New(r.GetBodyString()))
|
||||
if len(r.Cookie.GetSessionId()) == 0 {
|
||||
r.Cookie.SetSessionId(gctx.CtxId(r.Context()))
|
||||
}
|
||||
r.Middleware.Next()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user