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
@@ -42,11 +42,11 @@ func AppCryptoMiddleware() gin.HandlerFunc {
shouldEncrypt := encryptType != crypto.EncryptTypeNone
fmt.Printf("[AppCrypto] AppKey: %s, EncryptType: %s, SecretKey: %s, ShouldEncrypt: %v\n",
appKey, app.EncryptType, app.SecretKey, shouldEncrypt)
fmt.Printf("[AppCrypto] AppKey: %s, EncryptType: %s, EncryptKey: %s, ShouldEncrypt: %v\n",
appKey, app.EncryptType, app.EncryptKey, shouldEncrypt)
c.Set("should_encrypt_response", shouldEncrypt)
c.Set("crypto_manager", crypto.NewCryptoManager(encryptType, app.SecretKey))
c.Set("crypto_manager", crypto.NewCryptoManager(encryptType, app.EncryptKey))
c.Next()
}
@@ -68,7 +68,7 @@ func getAppCryptoManager(appKey string) (*crypto.CryptoManager, error) {
encryptType = crypto.EncryptTypeNone
}
return crypto.NewCryptoManager(encryptType, app.SecretKey), nil
return crypto.NewCryptoManager(encryptType, app.EncryptKey), nil
}
func decryptRequest(c *gin.Context, appKey string) ([]byte, error) {