diff --git a/handle/error.go b/handle/error.go index a5847a1..aa593d2 100644 --- a/handle/error.go +++ b/handle/error.go @@ -9,7 +9,6 @@ import ( "github.com/xmdhs/authlib-skin/model" "github.com/xmdhs/authlib-skin/service" - "github.com/xmdhs/authlib-skin/service/utils" sutils "github.com/xmdhs/authlib-skin/service/utils" ) @@ -42,7 +41,7 @@ func (h *Handel) handleErrorService(ctx context.Context, w http.ResponseWriter, h.handleError(ctx, w, err.Error(), model.ErrNotAdmin, 401, slog.LevelDebug) return } - if errors.Is(err, utils.ErrTokenInvalid) { + if errors.Is(err, sutils.ErrTokenInvalid) { h.handleError(ctx, w, err.Error(), model.ErrAuth, 401, slog.LevelDebug) return } diff --git a/handle/user.go b/handle/user.go index 3aeb743..1d60929 100644 --- a/handle/user.go +++ b/handle/user.go @@ -72,7 +72,7 @@ func (h *Handel) UserInfo() http.HandlerFunc { t := ctx.Value(tokenKey).(*model.TokenClaims) u, err := h.webService.Info(ctx, t) if err != nil { - h.handleError(ctx, w, err.Error(), model.ErrService, 500, slog.LevelWarn) + h.handleErrorService(ctx, w, err) return } encodeJson(w, model.API[model.UserInfo]{