收藏
回答

函数改造的问题?

(function  () {
      var scope = [{
          action: 'name/cos:PutObject',
          bucket: config.bucket,
          region: config.region,
          prefix: 'exampleobject',
      }];
      var policy = STS.getPolicy(scope);
      STS.getCredential({
          secretId: config.secretId,
          secretKey: config.secretKey,
          proxy: config.proxy,
          policy: policy,
          durationSeconds: config.durationSeconds,
      } , 
      function (err, credential) {
          console.log('getPolicy,getCredential:');
          console.log(JSON.stringify(policy, null, '    '));
          console.log(err || credential,77777);
         
          
      });  
    }) ();
 如题,我用云函数获取对象存储的tmpSecretId和tmpSecretKey,已经获取到了,并且可以打印出来,
但是怎么将函数credential返回给云函数,最后下发给小程序端呢?
w我是自学编程的,对于node.js还不是很熟悉

回答关注问题邀请回答
收藏
登录 后发表内容