fix: coderabbit review

This commit is contained in:
Seefs
2025-08-03 10:41:00 +08:00
parent c784a70277
commit d85eeabf11
6 changed files with 25 additions and 10 deletions

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设置和备用码