feat: 分离密码重置和修改密码功能

- 密码重置:用户忘记密码时通过邮箱/短信验证(需开启开关)
- 修改密码:已登录用户通过旧密码修改(固定功能,无需配置)
- 添加 EnablePasswordReset 开关控制密码重置功能
- PasswordResetMethod 只支持 email/sms 两种验证方式
- 添加短信配置管理功能
- 移除独立的应用邮箱设置页面
This commit is contained in:
2026-05-03 01:18:27 +08:00
parent 00067b1bff
commit 1f7dfd17a7
31 changed files with 2435 additions and 1477 deletions
+18
View File
@@ -166,6 +166,7 @@ func initMySQL() {
&model.DynamicCode{},
&model.PaymentChannel{},
&model.EmailConfig{},
&model.SmsConfig{},
&model.StorageConfig{},
&model.Captcha{},
&model.ApiUsage{},
@@ -174,6 +175,7 @@ func initMySQL() {
&model.Notification{},
&model.RiskControlRule{},
&model.EmailVerifyCode{},
&model.SmsVerifyCode{},
&model.AppSMTPConfig{},
&model.EmailTemplate{},
&model.VersionFile{},
@@ -384,6 +386,22 @@ func initData() {
DB.Model(&model.StorageConfig{}).Where("type = ? AND (status = '' OR status IS NULL)", "local").Update("status", "active")
}
var bepusdtCount int64
DB.Model(&model.PaymentChannel{}).Where("type = ?", "bepusdt").Count(&bepusdtCount)
if bepusdtCount == 0 {
log.Println("Creating BEPUSDT example payment channel...")
bepusdtChannel := model.PaymentChannel{
Name: "USDT支付",
Type: "bepusdt",
Icon: "",
Config: `{"api_url": "http://your-bepusdt-server:8080", "token": "your-api-token-here"}`,
Sort: 1,
Status: "inactive",
Remark: "BEPUSDT示例配置,请修改api_url和token后启用",
}
DB.Create(&bepusdtChannel)
}
initDocData()
}