From 1278e910f508c316b747d42223ed74e995e923c4 Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Tue, 17 Jun 2025 16:06:55 +0800 Subject: [PATCH] fix: Fix the issue of abnormal login log recording (#9139) Refs #9054 --- core/app/service/auth.go | 4 ++-- frontend/src/views/log/login/index.vue | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/core/app/service/auth.go b/core/app/service/auth.go index 726ab4bb1..1ecf5c651 100644 --- a/core/app/service/auth.go +++ b/core/app/service/auth.go @@ -37,7 +37,7 @@ func (u *AuthService) Login(c *gin.Context, info dto.Login, entrance string) (*d return nil, "", buserr.New("ErrRecordNotFound") } if nameSetting.Value != info.Name { - return nil, "ErrAuth", nil + return nil, "ErrAuth", buserr.New("ErrAuth") } if err = checkPassword(info.Password); err != nil { return nil, "ErrAuth", err @@ -47,7 +47,7 @@ func (u *AuthService) Login(c *gin.Context, info dto.Login, entrance string) (*d return nil, "", err } if len(entranceSetting.Value) != 0 && entranceSetting.Value != entrance { - return nil, "ErrEntrance", nil + return nil, "ErrEntrance", buserr.New("ErrEntrance") } mfa, err := settingRepo.Get(repo.WithByKey("MFAStatus")) if err != nil { diff --git a/frontend/src/views/log/login/index.vue b/frontend/src/views/log/login/index.vue index 7ad3427cd..9e1b6bd07 100644 --- a/frontend/src/views/log/login/index.vue +++ b/frontend/src/views/log/login/index.vue @@ -27,7 +27,10 @@