fix: user.LastLogin set gorm type:timestamp, gb28181 api GetGroupChannels modify

This commit is contained in:
pggiroro
2025-06-15 22:18:06 +08:00
parent 42acf47250
commit b2b511d755
2 changed files with 15 additions and 20 deletions

View File

@@ -13,7 +13,7 @@ type User struct {
Username string `gorm:"uniqueIndex;size:64"`
Password string `gorm:"size:60"` // bcrypt hash
Role string `gorm:"size:20;default:'user'"` // admin or user
LastLogin time.Time `gorm:"default:CURRENT_TIMESTAMP"`
LastLogin time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP"`
}
// BeforeCreate hook to hash password before saving