GithubHelp home page GithubHelp logo

Comments (6)

Hi-Rube avatar Hi-Rube commented on June 26, 2024

这个就直接200

from nodejs-sdk.

iyjian avatar iyjian commented on June 26, 2024

我也是哦.... 没人回答么?

from nodejs-sdk.

longbai avatar longbai commented on June 26, 2024

@iyjian 请麻烦告知下 nodejs sdk 的版本号

from nodejs-sdk.

Hi-Rube avatar Hi-Rube commented on June 26, 2024

@longbai
exports.uploadToken = function uploadToken(options) {
options = options || {};
options.scope = options.scope || this.options.bucket;
options.deadline = options.deadline || (utility.timestamp() + 3600);
var flags = options;
// 步骤2:将 Flags 进行安全编码
var encodedFlags = utility.base64encode(JSON.stringify(flags), true);

// 步骤3:将编码后的元数据混入私钥进行签名
// 步骤4:将签名摘要值进行安全编码
var encodedSign = this.signData(encodedFlags);

// 步骤5:连接各字符串,生成上传授权凭证
return this.options.accessKey + ':' + encodedSign + ':' + encodedFlags;
}; 这样生成是对的

from nodejs-sdk.

longbai avatar longbai commented on June 26, 2024

您贴的这个过程看起来是对的。 您是用PutPolicy(...) 这个函数出错的么?

from nodejs-sdk.

Hi-Rube avatar Hi-Rube commented on June 26, 2024

@longbai
大半年过去了都忘了,,,最近代码更新过了,没试过。 应该是获取token不对

from nodejs-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.