Skip to content

Commit

Permalink
FIX: browser.js add console.warn (#668)
Browse files Browse the repository at this point in the history
Close #648
  • Loading branch information
Ari1c authored and PeterRao committed Oct 23, 2019
1 parent 6357340 commit 1f49ff3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ for creating client.
region: 'oss-cn-hangzhou',
accessKeyId: '<access-key-id>',
accessKeySecret: '<access-key-secret>',
bucket: '<bucket-name>'
bucket: '<bucket-name>',
stsToken: '<security-token>'
});
client.list().then((result) => {
Expand Down
4 changes: 4 additions & 0 deletions lib/browser/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ function Client(options, ctx) {
module.exports = Client;

Client.initOptions = function initOptions(options) {
if (!options.stsToken) {
console.warn('Please use STS Token for safety, see more details at https://help.aliyun.com/document_detail/32077.html');
}

if (!options
|| !options.accessKeyId
|| !options.accessKeySecret) {
Expand Down

0 comments on commit 1f49ff3

Please sign in to comment.