u
This commit is contained in:
1 parent
5308dc8fda
commit
d51eacb8ad
32 files changed
+1788
-513
No files matched your search
@@ -5,6 +5,7 @@ import (
|
||||
"cn/oneao/base-go/utils/pathx"
|
||||
"cn/oneao/base-go/utils/response"
|
||||
"context"
|
||||
|
||||
"github.com/cloudwego/hertz/pkg/app"
|
||||
)
|
||||
|
||||
@@ -31,6 +32,7 @@ func Auth() app.HandlerFunc {
|
||||
|
||||
// 获取 token
|
||||
token := string(c.GetHeader("token"))
|
||||
|
||||
if token == "" {
|
||||
response.Fail(c).Code(response.HttpCode.Unauthorized).Send()
|
||||
c.Abort()
|
||||
|
||||
Reference in new issue
Block a user