Repository navigation
fix(keys): 界面里刚存的 key 不用重启就生效(#12) - #13
Merged
Merged
Conversation
AO 的库函数只认环境变量,而存好的 key 只在进程启动时映射一次;POST /ao-keys 只写文件。 新用户"打开 → 存 key → 写脚本"当场报"缺少 API Key",右栏却显示 ✅。 - 存完立刻同步进环境变量;换 key 跟着换;shell 里显式设的仍优先 - 我们映射进去的变量不再当"来自环境变量"重复列一遍 - 读不到 AO 供应商表时打一行日志,不再静默 - 没 key 的提示改为直达「⚙ 设置」,说明存完即用(中英) - vite.config 的 manualChunks 改函数形式:Vite 8 不再接受对象形式,Vite 7 下产物逐字节不变 真服务复现:空 key 目录起服务 → 存假 key → 写脚本,修前报缺 key,修后请求到了供应商(401)。 测试四个变异检查都会红;全量 271 通过。 Fixes #12
This was referenced Sep 21, 2026
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.
Fixes #12
问题
用户在界面里存好 key、验证通过、右栏显示 ✅,一点「生成脚本」就报「缺少 API Key:文本供应商「zhipu」没配 key」。
根因
AO 的库函数
run()只认环境变量;开片只在进程启动时把存好的 key 映射成环境变量,POST /ao-keys只写文件。所以「打开 → 存 key → 写脚本」这条新用户最常走的路必炸,重启才好。改动
vite.config.ts的manualChunks改函数形式:Vite 8 不再接受对象形式(chore(deps-dev): bump the build-tools group across 1 directory with 4 updates #10 的唯一报错),Vite 7 下产物逐字节不变验证