## 问题
- 之前使用UTC时间存储expires_at
- 前端解析时当成本地时间,导致显示时间差8小时
- 例如: 数据库存 08:37 (UTC),前端显示 08:37 (本地),实际应该显示 16:37
## 修复
1. database.js create方法: 使用本地时区格式化时间
- 使用 getFullYear/getMonth/getDate 等获取本地时间
- 格式化为 YYYY-MM-DD HH:MM:SS (本地时间)
2. database.js findByCode方法: 使用本地时区比较
- 改为 datetime('now', 'localtime')
- 确保与存储的本地时间格式匹配
3. 调试日志也使用本地时区
## 效果
- 创建分享时,expires_at存储的是服务器本地时间
- 前端显示时间与服务器时间一致
- 过期判断使用本地时区,结果正确
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
16 KiB
16 KiB