1.修改basedo字段类型
2、提供获取authen中用户信息的方法
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user