small fixes

This commit is contained in:
Alireza Ahmadi
2025-01-20 01:27:37 +01:00
parent f3432b119c
commit 60c64bab18
3 changed files with 5 additions and 7 deletions
+1 -3
View File
@@ -6,8 +6,6 @@ import (
"s-ui/logger"
"s-ui/util/common"
"time"
"gorm.io/gorm"
)
type UserService struct {
@@ -63,7 +61,7 @@ func (s *UserService) CheckUser(username string, password string, remoteIP strin
Where("username = ? and password = ?", username, password).
First(user).
Error
if err == gorm.ErrRecordNotFound {
if database.IsNotFound(err) {
return nil
} else if err != nil {
logger.Warning("check user err:", err, " IP: ", remoteIP)