feat: add SMS verification registration with UniSMS provider

- Add phone field to user model with index and helper methods
- Implement SMS provider interface with UniSMS (合一短信) implementation
- Add SMS verification code sending endpoint with rate limiting (1/60s)
- Support SMS registration in Register() (mutually exclusive with email)
- Add SMS configuration to admin settings (provider, keys, signature, template)
- Display phone number in admin user list contact column
- Add i18n translations for all SMS-related messages (zh-CN, en, zh-TW)
- Add Claude Code skills: sync-upstream, migrate-server
- Update CLAUDE.md with git conventions and deployment guide

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
nosqli
2026-03-06 23:57:15 +08:00
parent 4a4cf0a0df
commit 835cd8e74b
26 changed files with 815 additions and 17 deletions

View File

@@ -90,6 +90,12 @@ user.wechat_id_empty: "WeChat ID is empty!"
user.telegram_id_empty: "Telegram ID is empty!"
user.telegram_not_bound: "This Telegram account is not bound"
user.linux_do_id_empty: "Linux DO ID is empty!"
user.sms_verification_required: "SMS verification is enabled, please enter your phone number and verification code"
user.phone_format_invalid: "Invalid phone number format"
user.phone_already_taken: "This phone number is already registered"
user.send_sms_failed: "Failed to send SMS, please try again later"
user.sms_not_configured: "SMS service is not configured"
user.phone_empty: "Phone number cannot be empty"
# Quota messages
quota.negative: "Quota cannot be negative!"

View File

@@ -91,6 +91,12 @@ user.wechat_id_empty: "WeChat id 为空!"
user.telegram_id_empty: "Telegram id 为空!"
user.telegram_not_bound: "该 Telegram 账户未绑定"
user.linux_do_id_empty: "Linux DO id 为空!"
user.sms_verification_required: "管理员开启了短信验证,请输入手机号和验证码"
user.phone_format_invalid: "手机号格式不正确"
user.phone_already_taken: "该手机号已被注册"
user.send_sms_failed: "短信发送失败,请稍后重试"
user.sms_not_configured: "短信服务未配置"
user.phone_empty: "手机号不能为空"
# Quota messages
quota.negative: "额度不能为负数!"

View File

@@ -91,6 +91,12 @@ user.wechat_id_empty: "WeChat id 為空!"
user.telegram_id_empty: "Telegram id 為空!"
user.telegram_not_bound: "該 Telegram 帳號未綁定"
user.linux_do_id_empty: "Linux DO id 為空!"
user.sms_verification_required: "管理員開啟了簡訊驗證,請輸入手機號和驗證碼"
user.phone_format_invalid: "手機號格式不正確"
user.phone_already_taken: "該手機號已被註冊"
user.send_sms_failed: "簡訊發送失敗,請稍後重試"
user.sms_not_configured: "簡訊服務未配置"
user.phone_empty: "手機號不能為空"
# Quota messages
quota.negative: "額度不能為負數!"