Skip to content

Commit 1f49ff3

Browse files
Ari1cPeterRao
authored andcommitted
FIX: browser.js add console.warn (#668)
Close #648
1 parent 6357340 commit 1f49ff3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ for creating client.
223223
region: 'oss-cn-hangzhou',
224224
accessKeyId: '<access-key-id>',
225225
accessKeySecret: '<access-key-secret>',
226-
bucket: '<bucket-name>'
226+
bucket: '<bucket-name>',
227+
stsToken: '<security-token>'
227228
});
228229
229230
client.list().then((result) => {

lib/browser/client.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ function Client(options, ctx) {
9090
module.exports = Client;
9191

9292
Client.initOptions = function initOptions(options) {
93+
if (!options.stsToken) {
94+
console.warn('Please use STS Token for safety, see more details at https://help.aliyun.com/document_detail/32077.html');
95+
}
96+
9397
if (!options
9498
|| !options.accessKeyId
9599
|| !options.accessKeySecret) {

0 commit comments

Comments
 (0)