fix: coderabbit review

This commit is contained in:
Seefs committed 2025-08-03 10:41:00 +08:00
1 parent b48d3a6b40
commit b56a75cbe3
6 files changed
+25 -10

No files matched your search

+3 -1
View File
@@ -9,6 +9,8 @@ import (
"gorm.io/gorm"
)
var ErrTwoFANotEnabled = errors.New("用户未启用2FA")
// TwoFA 用户2FA设置表
type TwoFA struct {
Id int `json:"id" gorm:"primaryKey"`
@@ -210,7 +212,7 @@ func DisableTwoFA(userId int) error {
return err
}
if twoFA == nil {
return errors.New("用户未启用2FA")
return ErrTwoFANotEnabled
}
// 删除2FA设置和备用码