ali-sdk / ali-oss

Aliyun OSS(Object Storage Service) JavaScript SDK for the Browser and Node.js
https://www.alibabacloud.com/help/doc-detail/52834.htm
MIT License
1.95k stars 576 forks source link

client.assumeRole is not a function #695

Closed Murphycx94 closed 4 years ago

Murphycx94 commented 4 years ago

这啥情况啊?

const { STS } = require('aliyun-sdk')

const config = {
  accessKeyId: 'LTAI4FsjoDxUvDWpWHFRjKXU',
  accessKeySecret: 'qP4wlNaSx5coUs0QVLzrr3jE2jZi8w',
  roleArn: 'dannybaba',
  tokenExpireTime: '60',
  policy: ''
}

function sts () {
  const client = new STS({
    accessKeyId: config.accessKeyId,
    accessKeySecret: config.accessKeySecret
  })
  client.assumeRole(config.RoleArn, config.policy, config.tokenExpireTime).then((res) => {
    console.log(res)
  })
}
PeterRao commented 4 years ago

包名 ali-oss