From c56e1128ff44371f3cc6fb19f06ca3e1883e5b8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B6=9B?= Date: Thu, 22 Sep 2022 20:57:33 +0800 Subject: [PATCH] =?UTF-8?q?fix(login):=E4=BF=AE=E6=AD=A3=E7=9B=91=E7=AE=A1?= =?UTF-8?q?=E6=96=B9=E7=99=BB=E5=BD=95=E8=BF=94=E5=9B=9E=E7=9A=84=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/user.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/service/user.go b/service/user.go index bb59a49..24da8c5 100644 --- a/service/user.go +++ b/service/user.go @@ -79,14 +79,14 @@ func (u _UserService) ProcessManagementUserLogin(username, password string) (*mo return nil, exceptions.NewAuthenticationError(404, "用户不存在。") } if user.Type != 1 && user.Type != 2 { - return nil, exceptions.NewAuthenticationError(401, "用户类型不正确。") + return nil, exceptions.NewAuthenticationError(400, "用户类型不正确。") } if !user.Enabled { - return nil, exceptions.NewAuthenticationError(401, "用户已被禁用。") + return nil, exceptions.NewAuthenticationError(403, "用户已被禁用。") } hashedPassword := utils.Sha512Hex(password) if hashedPassword != user.Password { - return nil, exceptions.NewAuthenticationError(401, "用户凭据不正确。") + return nil, exceptions.NewAuthenticationError(402, "用户凭据不正确。") } if user.ResetNeeded { authErr := exceptions.NewAuthenticationError(401, "用户凭据已失效。")