7 Commits

Author SHA1 Message Date
iye
0a7c1ec130 feat(auth): wire Aliyun SMS provider for phone OTP login
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 4m33s
接入流程:
- src/lib/sms.ts: 封装 sendOtpSms(phone, code), 走 dysmsapi.aliyuncs.com 全局端点
- /api/auth/send-otp:
    * 生成 6 位验证码 → Redis 5min TTL
    * 调 Aliyun SDK 发送; OK → 200, isv.* 错误 → 422, 其它 → 500
    * SMS_NOT_CONFIGURED 时 dev 仍能 console.log 验证码联调
- auth.ts verifyOtp:
    * dev 万能码 123456 保留
    * 否则 redis.get(sms:otp:phone) 比对, 通过后 del 防重放
    * Redis 未配置时 prod 拒绝, dev 接受任意 6 位

环境变量 (.env.local, 不入仓库):
- SMS_ACCESS_KEY / SMS_SECRET_KEY (RAM 子账号)
- SMS_SIGN_NAME (例: 广州气元科技)
- SMS_TEMPLATE_CODE (例: SMS_506210397)

依赖:
+ @alicloud/dysmsapi20170525
+ @alicloud/openapi-client
+ @alicloud/tea-util

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 14:56:47 +08:00
iye
9fe9fa914f fix(ux): center modals with overlay; live vote with toast; deterministic mock data; cascade layer fix 2026-05-12 14:09:31 +08:00
iye
b7fbd5ac53 feat(auth): Auth.js v5 with phone OTP login, send-otp API, login page and user state in nav 2026-05-12 10:03:58 +08:00
iye
175276a085 feat(api): add REST API routes (artists/ranking/me/vote/signin) + Redis rate limiting + Zod validation 2026-05-12 09:59:38 +08:00
iye
91a0dd0f05 feat(db): Prisma 6 + MySQL schema with all models, seed script and env example 2026-05-12 09:51:17 +08:00
iye
abce95aae8 feat(components): add Button, Countdown, ArtistCard, Top12Bar, VoteModal core components 2026-05-12 09:37:23 +08:00
iye
8a83815f1c chore: bootstrap Next.js 16 + Tailwind v4 + TypeScript baseline 2026-05-12 09:26:46 +08:00