Commit Graph

6 Commits (3913640f5b12f749011cf06ac7dc2e1d2346a19c)

Author SHA1 Message Date
veypi e5170201ab refactor(settings): replace raw SQL conditions with GORM struct-based queries
- Replace db.Where("key = ?", ...) with db.Where(&Setting{Key: ...}) for type-safe queries
    - Replace db.Order("category, key") with structured clause.OrderBy in list API
    - Replace tx.Where("key = ?", ...) with tx.Where(&models.Setting{Key: ...}) in update API
    - Replace db.Where("key = ?", ...) with db.Where(&Setting{Key: ...}) in InitSettings, settingCache, SetSetting
4 days ago
veypi d3137955c3 feat(auth): add SMS/email verification code support for registration
- Add validateRegisterCode function to verify codes during registration
    - Integrate Aliyun SMS SDK (dysmsapi-20170525) replacing placeholder
    - Make cookie names configurable via JWT CookiePrefix setting
    - Rename login type "phone" to "sms" for consistency
    - Add 1-minute TTL cache for setting values
    - Add $fetch wrapper replacing raw fetch calls across all UI pages
    - Add verification code inputs with countdown send buttons to register UI
    - Move CSS/JS assets from root.html to auth and default layouts
    - Add scope parameter to VBase permission check methods
    - Add i18n entries for verification code messages (zh/en)
    - Fix route guard to use next('/403') instead of router.push
2 weeks ago
veypi bd033892d5 fix longtext 1 month ago
veypi bd5604a425 chore: bump version to v1.1.1 2 months ago
veypi e83444df4c refactor(models): Remove TableName methods and use global table prefix
- Add DB.Prefix "vb_" to cfg.DB config for global table prefix
    - Remove TableName() methods from all models (User, Role, Permission, etc.)
    - Remove Role.Scope field and its unique index with Code
    - Let GORM auto-generate table names with configured prefix
3 months ago
veypi 23c7f6cb7a refactor(auth): 重构认证系统,支持多种验证方式和 OAuth 提供商管理
- 新增验证模块(api/verification),统一处理短信和邮件验证码发送
    - 新增邮件发送功能(libs/email),支持 SMTP 协议
    - 重构短信模块(libs/sms),简化阿里云和腾讯云短信接口
    - 新增 OAuth 提供商管理 API(api/oauth/providers),支持 CRUD 操作
    - 新增系统设置管理 API(api/settings),支持动态配置更新
    - 重构认证方式管理(api/auth/methods),支持启用/禁用多种登录方式
    - 删除旧的 sms_providers 和 sms API 模块,迁移至新验证体系
    - 新增数据库模型:verification、email、oauth_provider、oauth_templates、setting
    - 更新配置文档,增加新功能的使用说明
4 months ago