revert: restore worker variable generation
This commit is contained in:
1 parent
1eb0e3b82b
commit
7c56b694b4
1 file changed
+2
-6
@@ -62,15 +62,11 @@ bucket_name = "${env.R2_BUCKET_NAME}"
|
||||
`;
|
||||
}
|
||||
|
||||
// 業務环境变量(从 JSON 解析)
|
||||
// 业务环境变量(从 JSON 解析)
|
||||
if (env.WORKER_VARS) {
|
||||
try {
|
||||
const vars = JSON.parse(env.WORKER_VARS);
|
||||
|
||||
// 關鍵修復:濾除不應該放在 [vars] 純字串區塊的資源綁定 Key
|
||||
const systemKeys = ['KV_NAMESPACE_ID', 'R2_BUCKET_NAME', 'D1_DATABASE_ID', 'WORKER_NAME'];
|
||||
const entries = Object.entries(vars).filter(([key]) => !systemKeys.includes(key));
|
||||
|
||||
const entries = Object.entries(vars);
|
||||
if (entries.length > 0) {
|
||||
toml += '\n[vars]\n';
|
||||
for (const [key, value] of entries) {
|
||||
|
||||
Reference in new issue
Block a user