Merged
Conversation
问题:状态栏始终显示 Free 套餐用量($0/$20),即使 Plus 套餐正在被扣费 根因:API 顶层返回 Free 套餐数据,实际数据在 subscriptionEntityList 中 修复: - 添加 SubscriptionEntity 结构体解析订阅列表 - 从列表中找到正在扣费的套餐(currentCredits < creditLimit) - 给 /api/usage 和 /api/subscription 传入 model 参数 修复 byebye-code#9 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
b8dc450 to
0a650f8
Compare
Merged
johnnyee
added a commit
to johnnyee/byebyecode
that referenced
this pull request
Dec 10, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题概述
状态栏始终显示 Free 套餐的用量($0/$20),即使 Plus 套餐正在被扣费。
根本原因
API 即使传入
model参数,顶层返回的仍然是 Free 套餐数据。实际的套餐用量数据在subscriptionEntityList数组中。解决方案
SubscriptionEntity结构体解析订阅列表calculate()方法,从列表中找到正在扣费的套餐(currentCredits < creditLimit)creditLimit和currentCredits进行显示/api/usage和/api/subscription都传入model参数修改的文件
src/api/mod.rsSubscriptionEntity结构体,修复calculate()逻辑src/api/client.rsget_usage()添加model参数src/api/cache.rsget_usage()调用src/core/segments/byebyecode_usage.rssrc/core/segments/byebyecode_subscription.rs测试计划
$4.53/$50)修复 #9
🤖 Generated with Claude Code