This commit is contained in:
2026-08-17 02:12:17 +08:00
parent 560ae46b82
commit 6a05803e08
96 changed files with 2888 additions and 685 deletions
+20 -19
View File
@@ -19,25 +19,25 @@ type securityConfigPO struct {
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
CaptchaOpen int
CaptchaTimeout int
KeyLong int
ImgWidth int
ImgHeight int
PwdMinLength int
PwdRequireUpper bool
PwdRequireLower bool
PwdRequireDigit bool
PwdRequireSpecial bool
LimitEnable bool
LimitWindow int
LimitCount int
LockEnable bool
LockThreshold int
LockDuration int
PwdExpireEnable bool
PwdExpireDays int
ForceNewUserChangePassword bool
CaptchaOpen int `gorm:"default:0"`
CaptchaTimeout int `gorm:"default:3600"`
KeyLong int `gorm:"default:6"`
ImgWidth int `gorm:"default:240"`
ImgHeight int `gorm:"default:80"`
PwdMinLength int `gorm:"default:8"`
PwdRequireUpper bool `gorm:"default:false"`
PwdRequireLower bool `gorm:"default:false"`
PwdRequireDigit bool `gorm:"default:false"`
PwdRequireSpecial bool `gorm:"default:false"`
LimitEnable bool `gorm:"default:false"`
LimitWindow int `gorm:"default:60"`
LimitCount int `gorm:"default:30"`
LockEnable bool `gorm:"default:false"`
LockThreshold int `gorm:"default:5"`
LockDuration int `gorm:"default:30"`
PwdExpireEnable bool `gorm:"default:false"`
PwdExpireDays int `gorm:"default:90"`
ForceNewUserChangePassword bool `gorm:"default:false"`
}
func (securityConfigPO) TableName() string { return "sys_security_config" }
@@ -54,6 +54,7 @@ func securityToPO(v *biz.SecurityConfig) securityConfigPO {
func (r *securityRepo) SecurityConfig(ctx context.Context) (*biz.SecurityConfig, error) {
if !r.data.databaseReady.Load() {
po := defaultSecurityConfig()
po.ID = 0
return securityFromPO(po), errors.New("数据库未初始化")
}
var po securityConfigPO