574 Commits

Author SHA1 Message Date
b6405c8f28 fix: IAP attach 后立即清除订阅缓存,修复 App 查到旧数据;返回值改用累计到期时间
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m33s
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-12 04:56:17 -07:00
add27aa4d9 fix: Apple IAP attach 支持家庭成员购买场景
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m15s
member 发起购买后订阅归属于 owner,但 attach 交易时校验
orderSub.UserId != u.Id 报"订单订阅与当前用户不匹配"。
现在通过 ResolveEntitlementUser 获取 EffectiveUserID,
允许 member 绑定属于其家庭 owner 的订阅。

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-12 03:38:42 -07:00
2f33e1e680 fix: 踢其他设备时不再清除踢人者自己的 session
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m29s
logoutUnbind 循环清理家庭成员时,踢人者(kicker)也在成员列表中,
导致 kicker 的设备被踢、session 被清,自己也下线了。
现在跳过 kickerUserID,只清缓存不踢设备不清 session。

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-12 03:05:34 -07:00
e4ec85c176 fix: clearAllSessions 改用 SCAN 查找 session,修复会话清理无效
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m37s
根因:登录时只写了 auth:session_id:{sessionId} (Redis SET),
从未写入 auth:user_sessions:{userId} sorted set,
导致 clearAllSessions 用 ZRange 永远返回空,session 根本没被清除。

修复:改用 SCAN auth:session_id:* 遍历所有 session key,
按 value 匹配 userId 找出该用户的全部 session 后删除,
同时清理关联的 device cache key。

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-12 02:47:32 -07:00
dddb8c7fe2 fix: 平级踢人后更新被踢设备 online 状态为 false
Some checks failed
Build docker and publish / build (20.15.1) (push) Has been cancelled
unbindDeviceLogic.logoutUnbind 中 KickDevice 后缺少
device.Online = false + UpdateDevice,导致后台仍显示在线

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-12 02:37:12 -07:00
384c8df506 fix: 踢出用户时清除所有 session,确保旧 token 立即失效
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m43s
- kickOfflineByUserDeviceLogic: 管理员踢设备后新增 clearAllSessions,
  之前只清单个 WebSocket session,用户可用旧 token 继续访问
- unbindDeviceLogic: 家庭成员被踢时增加踢设备+清 session;
  补全 session detail key 清理

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-12 02:19:35 -07:00
9b6efe2901 DefaultFamilyMaxSize
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m32s
2026-03-12 01:41:39 -07:00
7d5b4fcb84 邮箱修复
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m13s
2026-03-12 01:24:21 -07:00
a3cc23bbd4 feat: 绑定新邮箱时创建独立邮箱用户并转移订阅,而非挂在设备用户上
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 8m5s
- bindEmailWithVerificationLogic: 新邮箱路径改为创建独立 email user + joinFamily
- familyBindingHelper: clearMemberSubscribes → transferMemberSubscribesToOwner,订阅转移给 owner 而非删除
- accountMergeHelper: 同步更新调用点

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-12 00:52:50 -07:00
ec39579c39 fix: 注册 /v1/common/client/download 路由,修复客户端下载链接 404
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 8m8s
handler 和 logic 代码已迁移但 routes.go 漏注册该端点。

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-11 22:34:03 -07:00
b3c721ee58 fix: schema_compat 跳过不存在的表,避免 columnPatch 对缺失表 panic
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m33s
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-11 11:33:21 -07:00
772c12f821 fix: 注销后 device login 补回被删除的 device auth_method,修复前端按钮显示异常
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m18s
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-11 10:07:14 -07:00
3f56fc6def feat: Owner 退出登录时转移订阅/邮箱/家庭权限给 member,而非解散家庭
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m45s
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-11 09:00:35 -07:00
bb80df5786 权限问题
Some checks failed
Build docker and publish / build (20.15.1) (push) Has been cancelled
2026-03-11 08:06:13 -07:00
fafb229295 feat: 为折扣计算函数 getDiscount 引入新用户判断逻辑以支持新用户专属折扣。
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m37s
2026-03-11 03:56:48 -07:00
6557d06d59 feat: 添加兼容路由别名,修复前端 404 问题
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m16s
为 invite/stats, invite/sales, agent/downloads, agent/realtime
添加斜杠格式路由别名,兼容老项目前端请求路径。

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-11 01:51:32 -07:00
76a1500d3c x
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m55s
2026-03-11 01:13:56 -07:00
d78ec194af feat: IAP 对账逻辑在激活订单前显式更新订单状态为已支付。
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m16s
2026-03-10 21:53:14 -07:00
48383fa0a9 更新支付方式相关业务逻辑。
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m31s
2026-03-10 21:42:02 -07:00
4095552252 feat: 为订单表添加 IAP 相关字段并调整 IAP 对账逻辑参数。
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m34s
2026-03-10 21:12:39 -07:00
7c2eddf9c3 feat: 为订单表添加 app_account_token 字段并增强 Apple IAP 对账逻辑,支持通过交易历史记录查找。
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m25s
2026-03-10 20:47:24 -07:00
26f6400e74 feat: 苹果支付uuid 及设备逻辑
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 8m3s
2026-03-10 19:53:19 -07:00
EUForest
17163486f6 fix(subscribe): fix user subscription node retrieval logic to support directly assigned nodes 2026-03-10 18:29:19 +08:00
662ef6edb3 15分钟修改成5分钟
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m38s
2026-03-09 22:29:30 -07:00
a542a6df46 fix: 修复 退出登录 auth问题
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m45s
2026-03-09 09:04:47 -07:00
EUForest
884310d951 feat(routes): register admin authentication and captcha endpoints
- Register /v1/auth/captcha/generate route for user captcha
- Register /v1/auth/admin/login route for admin login
- Register /v1/auth/admin/reset-password route for admin password reset
- Register /v1/auth/admin/captcha/generate route for admin captcha
- Add admin authentication route group
2026-03-09 22:56:20 +08:00
EUForest
3ca471f58c refactor(auth): move captcha verification from handler to logic layer
- Remove duplicate captcha verification from user login handler
- Remove duplicate captcha verification from user register handler
- Remove duplicate captcha verification from password reset handler
- Remove duplicate captcha verification from phone login handler
- Remove duplicate captcha verification from phone register handler
- Update phone reset password handler structure
- Improve separation of concerns between handler and logic layers
- Handlers now only handle HTTP request/response, logic handles business rules
2026-03-09 22:56:07 +08:00
EUForest
fae77a8954 feat(auth): add captcha verification to phone authentication
- Add verifyCaptcha method to phone login logic
- Add verifyCaptcha method to phone registration logic
- Support both local and Turnstile captcha verification
- Check EnableUserLoginCaptcha for phone login
- Check EnableUserRegisterCaptcha for phone registration
- Validate captcha before processing phone authentication
2026-03-09 22:55:23 +08:00
EUForest
cea3e31f3a feat(auth): add captcha verification to user email authentication
- Add verifyCaptcha method to user login logic
- Add verifyCaptcha method to user registration logic
- Add verifyCaptcha method to password reset logic
- Support both local and Turnstile captcha verification
- Check respective configuration flags before verification
- Validate captcha code and ID for local captcha
- Validate Turnstile token for Turnstile mode
2026-03-09 22:55:08 +08:00
EUForest
9aaffec61d feat(auth): add admin authentication with permission checks
- Add admin login handler and logic with IsAdmin verification
- Add admin password reset handler and logic
- Add admin captcha generation handler and logic
- Implement device binding for admin login
- Add login logging for admin authentication
- Check EnableAdminLoginCaptcha configuration
- Separate admin authentication from user authentication
- Verify admin permission before allowing access
2026-03-09 22:54:59 +08:00
EUForest
2afb86f973 feat(auth): add user captcha generation endpoint
- Add handler for /v1/auth/captcha/generate endpoint
- Implement captcha generation logic based on configuration
- Support local image captcha generation with Redis storage
- Return Turnstile site key for Turnstile mode
- Check EnableUserLoginCaptcha configuration
2026-03-09 22:54:47 +08:00
EUForest
5727708bbd feat(config): add captcha configuration to global config response
- Add CaptchaType field to verify config
- Add EnableUserLoginCaptcha field
- Add EnableUserRegisterCaptcha field
- Add EnableAdminLoginCaptcha field
- Add EnableUserResetPasswordCaptcha field
- Expose captcha configuration to frontend
2026-03-09 22:54:33 +08:00
EUForest
f224d09d09 feat(types): update request types with captcha fields
- Add CaptchaId and CaptchaCode to UserLoginRequest
- Add CaptchaId and CaptchaCode to UserRegisterRequest
- Add CaptchaId and CaptchaCode to ResetPasswordRequest
- Add CaptchaId and CaptchaCode to TelephoneLoginRequest
- Add CaptchaId and CaptchaCode to TelephoneUserRegisterRequest
- Add CaptchaId and CaptchaCode to TelephoneResetPasswordRequest
- Add GenerateCaptchaResponse type
- Add AdminLoginRequest and AdminResetPasswordRequest types
2026-03-09 22:54:21 +08:00
EUForest
eb327b26b9 feat(api): add captcha fields and admin authentication endpoints
- Add CaptchaId and CaptchaCode fields to login/register/reset requests
- Add /v1/auth/captcha/generate endpoint for user captcha generation
- Add /v1/auth/admin/login endpoint for admin authentication
- Add /v1/auth/admin/reset-password endpoint for admin password reset
- Add /v1/auth/admin/captcha/generate endpoint for admin captcha generation
- Update GlobalConfigResponse with new verify configuration fields
- Add GenerateCaptchaResponse type for captcha generation
2026-03-09 22:54:08 +08:00
EUForest
0f6fddc36d feat(error): add PermissionDenied error code
- Add error code 40008 for permission denied scenarios
- Add corresponding error message for admin permission checks
2026-03-09 22:53:59 +08:00
EUForest
2fd22c97e0 feat(migration): add captcha configuration migration
- Add CaptchaType field for selecting captcha implementation
- Add EnableUserLoginCaptcha for user login verification
- Add EnableUserRegisterCaptcha for user registration verification
- Add EnableAdminLoginCaptcha for admin login verification
- Add EnableUserResetPasswordCaptcha for password reset verification
- Remove deprecated EnableLoginVerify, EnableRegisterVerify, EnableResetPasswordVerify fields
- Support rollback with down migration
2026-03-09 22:53:45 +08:00
EUForest
36119b842c build(deps): add base64Captcha library for local captcha generation
- Add github.com/mojocn/base64Captcha v1.3.6
- Add github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 (indirect)
- Add golang.org/x/image v0.23.0 (indirect)
2026-03-09 22:53:34 +08:00
EUForest
0dbcff85f1 feat(captcha): add captcha service interface and implementations
- Add captcha service interface with Generate and Verify methods
- Implement local image captcha using base64Captcha library
- Implement Cloudflare Turnstile verification wrapper
- Support Redis-based captcha storage with 5-minute expiration
- Add factory method for creating captcha service instances
2026-03-09 22:53:13 +08:00
5f884ed737 fix: 修复 读写不一致 appleiap 的问题
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m39s
2026-03-09 05:17:26 -07:00
b9cc33ad70 chore: 补充 order.api 定义,新增 ActivateOrder 接口
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m49s
2026-03-09 04:18:35 -07:00
1372510abf feat: 后台管理新增手动激活订单接口
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m53s
POST /v1/admin/order/activate { "order_no": "xxx" }
- 支持对 pending(1) 或 closed(3) 状态的订单手动激活
- 强制更新为 paid(2) 并 enqueue 激活任务
- 用于处理 IAP 被误关闭或客户端未成功回调的订单
2026-03-09 03:58:57 -07:00
57fa2b4d69 fix: IAP 重复交易检测优化,防止续期误拦和孤儿订单
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m33s
1. 关闭孤儿订单:检测到重复交易时,立即关闭新的 pending 订单(status=3)
2. tradeNo 候选改为只用 transactionId,不再用 originalTransactionId
   - originalTransactionId 是整个订阅族共享的,续期时会误命中旧订单
   - originalTransactionId 仍用于 IAP 事务表幂等检查(FindByOriginalId)
2026-03-09 02:32:42 -07:00
b303f16525 fix: 退出登录不删除用户订阅,保留订阅数据
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m52s
2026-03-09 01:48:54 -07:00
9c197442a6 fix: 退出登录时删除用户订阅并清理订阅缓存
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m45s
- 事务内删除用户所有订阅记录
- 事务后清理订阅缓存、套餐缓存、节点缓存
2026-03-09 01:31:04 -07:00
d6437f043f fix: 退出登录时解绑邮箱和家庭组,清除所有session
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m54s
- logoutUnbind 新增删除非 device 类型的 auth_methods(解绑邮箱)
- 清除用户所有 session 而非仅当前 session
- 事务前收集家庭成员 ID,事务后清理成员缓存
- 清理邮箱相关 Redis 缓存
2026-03-09 01:12:38 -07:00
130fb702ab fix: IAP 支付流程优化与关键 bug 修复
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m42s
- getStatusLogic 类型断言修复(*user.User)
- restoreLogic 事务拆分为单条处理 + appAccountToken 解析
- attachTransactionLogic 提取 ParseProductIdDuration 共享函数
- 新增 config_helper.go 统一 Apple API 配置加载
- reconcileLogic 补充 BundleID 配置读取
- activateOrderLogic 邀请赠送天数逻辑完善

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-09 00:27:16 -07:00
dcfcd036de x
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m46s
2026-03-08 22:37:58 -07:00
f792157d6e 邀请记录
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m22s
2026-03-08 21:57:20 -07:00
79a97ec569 限制套餐具体到 档位
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m45s
2026-03-08 21:25:07 -07:00
EUForest
fae8787ff4 Merge branch 'master' of https://github.com/OmnTeam/ppanel-server 2026-03-08 23:24:05 +08:00