Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
5bb73239
authored
Aug 31, 2025
by
IcedTangerine
Committed by
GitHub
Aug 31, 2025
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1672 from feitianbubu/pr/fix-mysql-default-false
fix: prevent loop auto-migrate with bool default false
parents
3d862792
d47779b0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
model/twofa.go
+2
-2
No files found.
model/twofa.go
View file @
5bb73239
...
...
@@ -16,7 +16,7 @@ type TwoFA struct {
Id
int
`json:"id" gorm:"primaryKey"`
UserId
int
`json:"user_id" gorm:"unique;not null;index"`
Secret
string
`json:"-" gorm:"type:varchar(255);not null"`
// TOTP密钥,不返回给前端
IsEnabled
bool
`json:"is_enabled"
gorm:"default:false"
`
IsEnabled
bool
`json:"is_enabled"`
FailedAttempts
int
`json:"failed_attempts" gorm:"default:0"`
LockedUntil
*
time
.
Time
`json:"locked_until,omitempty"`
LastUsedAt
*
time
.
Time
`json:"last_used_at,omitempty"`
...
...
@@ -30,7 +30,7 @@ type TwoFABackupCode struct {
Id
int
`json:"id" gorm:"primaryKey"`
UserId
int
`json:"user_id" gorm:"not null;index"`
CodeHash
string
`json:"-" gorm:"type:varchar(255);not null"`
// 备用码哈希
IsUsed
bool
`json:"is_used"
gorm:"default:false"
`
IsUsed
bool
`json:"is_used"`
UsedAt
*
time
.
Time
`json:"used_at,omitempty"`
CreatedAt
time
.
Time
`json:"created_at"`
DeletedAt
gorm
.
DeletedAt
`json:"-" gorm:"index"`
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment