adp-openclaw 0.0.39 → 0.0.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/adp-upload-tool.ts +9 -2
package/package.json
CHANGED
package/src/adp-upload-tool.ts
CHANGED
|
@@ -190,13 +190,20 @@ export async function getStorageCredential(
|
|
|
190
190
|
throw new Error(`获取存储凭证失败: ${response.status} ${errorText}`);
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
const
|
|
193
|
+
const responseData = await response.json();
|
|
194
194
|
|
|
195
|
+
// 调试:打印原始响应的所有 key
|
|
196
|
+
console.log(`[ADP-UPLOAD] Response keys: ${Object.keys(responseData).join(', ')}`);
|
|
197
|
+
|
|
198
|
+
// 上游 API 返回的数据可能被包装在 result 字段中
|
|
199
|
+
const result = responseData.result || responseData;
|
|
200
|
+
|
|
201
|
+
console.log(`[ADP-UPLOAD] Result keys: ${Object.keys(result).join(', ')}`);
|
|
195
202
|
console.log(`[ADP-UPLOAD] Response received: bucket=${result.bucket}, region=${result.region}, has_upload_url=${!!result.upload_url}, has_file_url=${!!result.file_url}`);
|
|
196
203
|
|
|
197
204
|
// 检查响应数据的完整性 - 现在主要检查 upload_url 和 file_url
|
|
198
205
|
if (!result.upload_url || !result.file_url) {
|
|
199
|
-
console.error(`[ADP-UPLOAD] Missing required fields in response:`, JSON.stringify(
|
|
206
|
+
console.error(`[ADP-UPLOAD] Missing required fields in response:`, JSON.stringify(responseData).substring(0, 500));
|
|
200
207
|
throw new Error("获取存储凭证失败: 缺少upload_url或file_url信息");
|
|
201
208
|
}
|
|
202
209
|
|