Skip to content

Commit 5a6af14

Browse files
author
carsonxu
committed
v2.11.3 兼容 secretId/secretKey
1 parent fccda0c commit 5a6af14

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cos-nodejs-sdk-v5",
3-
"version": "2.11.2",
3+
"version": "2.11.3",
44
"description": "cos nodejs sdk v5",
55
"main": "index.js",
66
"types": "index.d.ts",

sdk/cos.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,15 @@ var COS = function (options) {
5959
if (this.options.AppId) {
6060
console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g: "test-1250000000").');
6161
}
62+
// 云API SDK 用小写密钥,这里兼容并 warning
63+
if (this.options.secretId || this.options.secretKey) {
64+
if (this.options.secretId && !this.options.SecretId) this.options.SecretId = this.options.secretId;
65+
if (this.options.secretKey && !this.options.SecretKey) this.options.SecretKey = this.options.secretKey;
66+
console.warn('warning: Please change options secretId/secretKey to SecretId/SecretKey.');
67+
}
6268
if (util.isWeb()) {
63-
console.warn('warning: cos-nodejs-sdk-v5 不支持浏览器使用,请改用 cos-js-sdk-v5,参考文档: https://cloud.tencent.com/document/product/436/11459');
64-
console.warn('warning: cos-nodejs-sdk-v5 does not support browsers. Please use cos-js-sdk-v5 instead, See: https://cloud.tencent.com/document/product/436/11459');
69+
console.warn('warning: cos-nodejs-sdk-v5 不支持浏览器使用,请改用 cos-js-sdk-v5,参考文档: https://cloud.tencent.com/document/product/436/11459');
70+
console.warn('warning: cos-nodejs-sdk-v5 does not support browsers. Please use cos-js-sdk-v5 instead, See: https://cloud.tencent.com/document/product/436/11459');
6571
}
6672
event.init(this);
6773
task.init(this);

0 commit comments

Comments
 (0)