chore: format code

This commit is contained in:
Shishkevich D. 2025-05-03 09:56:37 +00:00 committed by mhsanaei
parent 2eb10ac9e2
commit 4cea5c394c
No known key found for this signature in database
GPG key ID: D875CD086CF668A0
4 changed files with 14 additions and 14 deletions

4
go.mod
View file

@ -15,8 +15,10 @@ require (
github.com/robfig/cron/v3 v3.0.1 github.com/robfig/cron/v3 v3.0.1
github.com/shirou/gopsutil/v4 v4.25.3 github.com/shirou/gopsutil/v4 v4.25.3
github.com/valyala/fasthttp v1.61.0 github.com/valyala/fasthttp v1.61.0
github.com/xlzd/gotp v0.1.0
github.com/xtls/xray-core v1.250306.1-0.20250430044058-87ab8e512882 github.com/xtls/xray-core v1.250306.1-0.20250430044058-87ab8e512882
go.uber.org/atomic v1.11.0 go.uber.org/atomic v1.11.0
golang.org/x/crypto v0.37.0
golang.org/x/text v0.24.0 golang.org/x/text v0.24.0
google.golang.org/grpc v1.72.0 google.golang.org/grpc v1.72.0
gorm.io/driver/sqlite v1.5.7 gorm.io/driver/sqlite v1.5.7
@ -78,14 +80,12 @@ require (
github.com/valyala/fastjson v1.6.4 // indirect github.com/valyala/fastjson v1.6.4 // indirect
github.com/vishvananda/netlink v1.3.0 // indirect github.com/vishvananda/netlink v1.3.0 // indirect
github.com/vishvananda/netns v0.0.5 // indirect github.com/vishvananda/netns v0.0.5 // indirect
github.com/xlzd/gotp v0.1.0 // indirect
github.com/xtls/reality v0.0.0-20240909153216-e26ae2305463 // indirect github.com/xtls/reality v0.0.0-20240909153216-e26ae2305463 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.uber.org/automaxprocs v1.6.0 // indirect go.uber.org/automaxprocs v1.6.0 // indirect
go.uber.org/mock v0.5.2 // indirect go.uber.org/mock v0.5.2 // indirect
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect go4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect
golang.org/x/arch v0.16.0 // indirect golang.org/x/arch v0.16.0 // indirect
golang.org/x/crypto v0.37.0 // indirect
golang.org/x/mod v0.24.0 // indirect golang.org/x/mod v0.24.0 // indirect
golang.org/x/net v0.39.0 // indirect golang.org/x/net v0.39.0 // indirect
golang.org/x/sync v0.13.0 // indirect golang.org/x/sync v0.13.0 // indirect

View file

@ -8,8 +8,8 @@ import (
"x-ui/logger" "x-ui/logger"
"x-ui/util/crypto" "x-ui/util/crypto"
"gorm.io/gorm"
"github.com/xlzd/gotp" "github.com/xlzd/gotp"
"gorm.io/gorm"
) )
type UserService struct { type UserService struct {
@ -49,14 +49,14 @@ func (s *UserService) CheckUser(username string, password string, twoFactorCode
return nil return nil
} }
twoFactorEnable, err := s.settingService.GetTwoFactorEnable(); twoFactorEnable, err := s.settingService.GetTwoFactorEnable()
if err != nil { if err != nil {
logger.Warning("check two factor err:", err) logger.Warning("check two factor err:", err)
return nil return nil
} }
if twoFactorEnable { if twoFactorEnable {
twoFactorToken, err := s.settingService.GetTwoFactorToken(); twoFactorToken, err := s.settingService.GetTwoFactorToken()
if err != nil { if err != nil {
logger.Warning("check two factor token err:", err) logger.Warning("check two factor token err:", err)