Commit Graph

6 Commits

Author SHA1 Message Date
xiezhouwei 789f3b43e4 fix: prevent float-to-int truncation turning small billing amounts (e.g. 0.01) into 0 in use-price paths\n\n- service/quota.go: replace IntPart() with Round(0).IntPart() + safety net\n- relay/helper/price.go: replace int(float64) with int(math.Round()) + safety net\n- controller/channel-test.go: same fix for test billing calculation\n- All use-price paths now round instead of truncate, and guarantee minimum 1 quota when effective pricing > 0 2026-06-23 11:26:00 +08:00
xiezhouwei 09d6a7305e feat: add admin-controlled toggles for header theme/language display in system settings 2026-06-22 11:46:31 +08:00
xiezhouwei 6fc114ec32 feat: add Alipay and WeChat Pay payment gateway support
- Add Alipay payment backend: RSA2 signing/verification, async notify, sync return
- Add WeChat Pay backend: APIv3 signing, AES-GCM decryption, H5 pay, async notify
- Add payment setting UI components for Alipay and WeChat Pay
- Register config keys (24 items) in OptionMap for both gateways
- Add API routes: /api/user/alipay/pay, /api/user/wechatpay/pay,
  /api/alipay/notify, /api/alipay/return, /api/wechatpay/notify
- Add enable_alipay_topup/enable_wechatpay_topup to /api/status endpoint
- Add i18n translations for all new UI strings (11 locales)
- Fix: data is not defined ReferenceError in topup/index.jsx useEffect
- Fix: unused imports in controller/topup_wechat.go
- Update .gitignore for build artifacts
2026-06-08 09:01:33 +08:00
xiezhouwei b63f75ade4 feat: add captcha verification for login form
- Add /api/captcha endpoint with captcha generation/verification service
- Add captcha_enabled option in system settings (model/option.go)
- Add captcha display and refresh logic in LoginForm
- Fix captcha not showing on Chrome due to Semi UI Form.Input suffix
  incompatibility; refactored to standalone flex layout
- Fix stale localStorage cache preventing captcha rendering on first visit
  by proactively fetching /api/status on LoginForm mount
- Add captcha_enabled toggle in admin SystemSetting panel
- Add i18n keys for captcha-related text (zh-CN, en)
2026-06-05 13:57:13 +08:00
xiezhouwei aa1c9559c3 feat: 操作日志功能实现及字段级diff优化
- 新增操作日志完整功能: model/service/controller/middleware + 前端页面
- 用户管理 UpdateUser/ManageUser 改为字段级 diff,仅记录实际变更字段
- 模型定价 UpdateOption 改为模型粒度 diff,仅记录变更的模型条目
- 防止中间件与 controller 重复记录操作日志
- 修复前端侧边栏操作日志模块可见性及权限配置合并
2026-06-04 15:17:59 +08:00
xiezhouwei ccd7d1f4c2 Initial commit 2026-06-03 10:01:10 +08:00