"frontend/src/views/git@web.lueluesay.top:chenxi/sub2api.git" did not exist on "5bae3b05773f23722bae7600e9f14a1c192b64d1"
  1. 17 Apr, 2026 11 commits
    • erio's avatar
      feat(gateway): raise upstream response read limit 8MB -> 128MB (configurable) · bf0bbe0b
      erio authored
      图片生成 API 返回的 base64 内联图响应经常超过 8MB 单次读取上限,被
      ReadUpstreamResponseBody 拦截成 502 upstream_error。
      
      单张 4K PNG base64 最坏约 67MB,多张候选图或 imageSize=4K 的 image_generation
      一次请求能轻松到 30MB+。把默认上限提到 128MB 能覆盖 2-3 张 4K 图,相对
      请求体上限 256MB 仍有缓冲;同时抽出 config.DefaultUpstreamResponseReadMaxBytes
      共享常量,viper 默认值和 service 层兜底共用,消除两处同步魔法数字。
      
      仍可通过 gateway.upstream_response_read_max_bytes 配置项覆盖。
      bf0bbe0b
    • erio's avatar
      fix(billing): reject rate_multiplier <= 0 on save; clamp negatives to 0 in compute · df57d277
      erio authored
      分组倍率和用户专属倍率在保存时没有校验,0 会触发计费层的 `<=0 → 1.0`
      防御条款,结果订阅/余额分组按标准价扣费;完全是沉默地绕过了业务规则。
      
      - 保存校验(admin_service):CreateGroup / UpdateGroup / BatchSetGroupRateMultipliers /
        UpdateUser.SyncUserGroupRates 全部要求 > 0
      - 计算层(billing_service):三处 `<=0 → 1.0` 改为 `<0 → 0`;负数按 0 结算,
        避免配置异常被静默按 1x 收费
      - 前端:分组倍率 / 用户专属倍率输入 min 统一到 0.001
      - 删除未使用的 IsFreeSubscription 方法
      
      测试:新增 billing_service_rate_multiplier_test.go 端到端验证;更新原有锁定
      旧 `<=0 → 1.0` 行为的测试。
      df57d277
    • erio's avatar
      fix(admin): prevent browser password manager from autofilling account API key · 948d8e6d
      erio authored
      Chrome's password manager matched the apikey-type account's Base URL + API Key
      inputs as a login form and autofilled the last saved password by domain, so
      editing a Gemini account could overwrite its apikey with a Claude key that
      shared the same Base URL. Add autocomplete="new-password" plus data-*-ignore
      attributes for 1Password / LastPass / Bitwarden to opt the field out of every
      major password manager's autofill.
      948d8e6d
    • erio's avatar
      fix(usage): subscription billing honours group rate multiplier · 44cdef79
      erio authored
      Subscription-mode billing was consuming quota at TotalCost (raw) instead of
      ActualCost (TotalCost * RateMultiplier), so per-group rate multipliers —
      including free subscriptions (multiplier = 0) — were silently ignored.
      Switch the three subscription cost writes in buildUsageBillingCommand,
      finalizePostUsageBilling, and the legacy postUsageBilling fallback to
      ActualCost, and add a table-driven test covering 2x / 0.5x / free multipliers
      plus a balance-mode regression check.
      44cdef79
    • erio's avatar
      fix(payment): store provider config as plaintext JSON with legacy ciphertext fallback · fd0c9a13
      erio authored
      Without TOTP_ENCRYPTION_KEY, saved payment configs were lost on restart because
      the AES round-trip failed silently. Write new records as plaintext JSON; read
      path tries JSON first, falls back to legacy AES decrypt when a key is present,
      and treats unreadable values as empty so admins can re-enter them via the UI.
      fd0c9a13
    • github-actions[bot]'s avatar
      6cfdf4ec
    • Wesley Liddick's avatar
      Merge pull request #1683 from FjlI5/dev-main · 358ff6a6
      Wesley Liddick authored
      fix:修复上游账号为OpenAI API key时Claude Code调用缓存率低的问题
      358ff6a6
    • Wesley Liddick's avatar
      Merge pull request #1687 from touwaeriol/refactor/upstream-response-limit-dedup · 41fbdba1
      Wesley Liddick authored
      refactor: extract ReadUpstreamResponseBody to deduplicate response read + too-large handling
      41fbdba1
    • Wesley Liddick's avatar
      Merge pull request #1702 from StarryKira/fix/outbox-watermark-context-dedup-1691 · c22d11ce
      Wesley Liddick authored
      fix: fix outbox watermark context expiry and add in-batch group rebuild dedup
      c22d11ce
    • shaw's avatar
      5d586a9f
    • shaw's avatar
      feat: 支持opus-4.7 · a789c8c4
      shaw authored
      a789c8c4
  2. 16 Apr, 2026 7 commits
  3. 15 Apr, 2026 15 commits
  4. 14 Apr, 2026 7 commits
    • erio's avatar
      fix: gofmt payment_service.go and payment_order.go · c2108421
      erio authored
      c2108421
    • erio's avatar
      fix(payment): use original recharge amount in product name, not pay_amount · 342dbd2e
      erio authored
      Product name (e.g. "快代码科技工作室 100 元") should show the user's
      original recharge amount (limitAmount), not the fee-inclusive pay amount.
      The gateway receives payAmount separately for actual charging.
      342dbd2e
    • erio's avatar
      21f22b50
    • erio's avatar
      fix: gofmt formatting and update API contract test for new fields · 60614e6f
      erio authored
      - Fix gofmt alignment in setting_handler.go, settings.go, payment_config_service.go
      - Add payment_balance_recharge_multiplier and payment_recharge_fee_rate
        to API contract test expected JSON
      60614e6f
    • erio's avatar
      fix(payment): show full amount breakdown on payment result page · 3053c56c
      erio authored
      - Show base amount (充值金额) as first line
      - Show fee amount with percentage when fee_rate > 0
      - Show pay_amount (实付金额) in bold primary color
      - Show credited amount (到账金额) when different from pay_amount
      - Compute baseAmount and feeAmount from backend order data
      3053c56c
    • erio's avatar
      fix(payment): enhance fee rate input validation and UI · d149dbc9
      erio authored
      Backend:
      - Validate recharge_fee_rate: 0 ≤ rate ≤ 100, max 2 decimal places
      
      Frontend settings:
      - Add % suffix icon to fee rate input
      - Enforce max=100, min=0, step=0.01 with 2 decimal precision
      d149dbc9
    • erio's avatar
      fix(payment): integrate recharge fee rate in order flow and fix UI display · e761d38f
      erio authored
      Backend:
      - Use cfg.RechargeFeeRate in order creation instead of hardcoded 0
      - Remove dead getFeeRate stub method
      - All amounts computed server-side: order_amount, pay_amount, fee_rate
      
      Frontend - PaymentView:
      - Read recharge_fee_rate from checkout-info API (not per-method)
      - Show fee breakdown only when fee_rate > 0
      - Show credited amount only when multiplier ≠ 1
      
      Frontend - Order display (user + admin):
      - Fix fee_rate * 100 bug (fee_rate is already a percentage)
      - OrderTable: show pay_amount as primary, fee/credited as sub-lines
      - AdminOrderDetail: full breakdown (base/fee/paid/credited)
      - AdminRefundDialog: label "到账金额" for clarity
      - PaymentResultView: show pay_amount with fee info
      
      Types + i18n:
      - Add recharge_fee_rate to CheckoutInfoResponse
      - Add fee_rate to CreateOrderResult
      - Add translations: creditedAmount, fee, baseAmount, includedInPayAmount
      e761d38f