diff --git a/utils/auth/auth.go b/utils/auth/auth.go index 6f62c4eb..c219c106 100644 --- a/utils/auth/auth.go +++ b/utils/auth/auth.go @@ -3,7 +3,7 @@ package auth import ( "encoding/json" "github.com/golang-jwt/jwt" - "log" + "github.com/zeromicro/go-zero/core/logx" "net/http" "time" ) @@ -58,13 +58,13 @@ func CheckAuth(r *http.Request) UserInfo { token = r.Header.Get("Auth-Key") } if token == "" { - log.Println("token is empty") + logx.Debug("token is empty") return UserInfo{} } //解析token userInfo, err := ParseJwtToken(token) if err != nil { - log.Println(err) + logx.Debug(err) return UserInfo{} } return userInfo