1.修改basedo字段类型

2、提供获取authen中用户信息的方法
This commit is contained in:
2025-12-02 09:07:21 +08:00
parent 8ed282877e
commit cd3571554f
3 changed files with 34 additions and 4 deletions

View File

@@ -2,6 +2,7 @@ package middleware
import (
"context"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/net/ghttp"
"github.com/gogf/gf/v2/os/gtime"
@@ -35,6 +36,7 @@ func Limiter(r *ghttp.Request) {
r.Middleware.Next()
}
func Auth(r *ghttp.Request) {
//utils.GetUserInfo(r.GetCtx())
token := r.Header.Get("Authorization")
if token == "" || !gstr.HasPrefix(token, "Bearer ") {
r.Response.WriteStatusExit(401, "Unauthorized")