mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-13 20:53:49 +08:00
1、泛型化参数,预留泛型约束,方便以后代码扩展的类型安全校验
2、升级goframe至v2.7.3
This commit is contained in:
@@ -27,11 +27,11 @@ func (s *sHook) accessLog(r *ghttp.Request) {
|
||||
}
|
||||
|
||||
var ctx = r.Context()
|
||||
if contexts.Get(ctx) == nil {
|
||||
if contexts.Get[any](ctx) == nil {
|
||||
return
|
||||
}
|
||||
|
||||
contexts.SetDataMap(ctx, g.Map{
|
||||
contexts.SetDataMap[any](ctx, g.Map{
|
||||
"request.takeUpTime": gtime.Now().Sub(gtime.New(r.EnterTime)).Milliseconds(),
|
||||
// ...
|
||||
})
|
||||
|
||||
@@ -71,7 +71,7 @@ func (s *sHook) lastAdminActive(r *ghttp.Request) {
|
||||
|
||||
var (
|
||||
ctx = r.Context()
|
||||
member = contexts.GetUser(ctx)
|
||||
member = contexts.GetUser[any](ctx)
|
||||
)
|
||||
|
||||
if member == nil || member.App != consts.AppAdmin {
|
||||
|
||||
Reference in New Issue
Block a user