@be-link/cos 1.12.5 → 1.12.7
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/bin/upload.js +4 -10
- package/package.json +1 -1
package/bin/upload.js
CHANGED
|
@@ -62,7 +62,9 @@ async function getTempCredentials(mode) {
|
|
|
62
62
|
|
|
63
63
|
try {
|
|
64
64
|
const response = await fetch(url, { method: 'POST' });
|
|
65
|
+
console.log('🔐 响应:', response);
|
|
65
66
|
const result = await response.json();
|
|
67
|
+
console.log('🔐 结果:', result);
|
|
66
68
|
const data = result?.data || {};
|
|
67
69
|
const credentials = data?.credentials;
|
|
68
70
|
|
|
@@ -119,18 +121,10 @@ async function initCOS() {
|
|
|
119
121
|
const secretId = process.env.COS_SECRET_ID;
|
|
120
122
|
const secretKey = process.env.COS_SECRET_KEY;
|
|
121
123
|
|
|
122
|
-
if (!secretId || !secretKey) {
|
|
123
|
-
console.error('❌ 错误:未找到 COS 密钥配置');
|
|
124
|
-
console.error(' 请设置环境变量:');
|
|
125
|
-
console.error(' - COS_SECRET_ID');
|
|
126
|
-
console.error(' - COS_SECRET_KEY');
|
|
127
|
-
process.exit(1);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
124
|
console.log('✅ 使用环境变量中的密钥');
|
|
131
125
|
cos = new COS({
|
|
132
|
-
SecretId:
|
|
133
|
-
SecretKey:
|
|
126
|
+
SecretId: 'AKIDx3wfJo5e4FAqHSOJ5cu2y3zh9MK2Uhy6',
|
|
127
|
+
SecretKey: '3sgW7V7W1PZWIqAKI8krpY3JL9j5C3e1',
|
|
134
128
|
});
|
|
135
129
|
|
|
136
130
|
return cos;
|