1.1.3 • Published 6 years ago

@blueshit/oss-sign v1.1.3

Weekly downloads
6
License
MIT
Repository
github
Last release
6 years ago

oss-sign

阿里云OSS签名

const OSSSign = require("@blueshit/oss-sign");

const signer = new OSSSign({
  accessKeyId: 'xxx',
  accessKeySecret: 'xxx',
  endpoint: 'http://xxx.oss-cn-hangzhou.aliyuncs.com',
})

/**
 * 获取 OSS 签名
 * @param {string} filename 文件名
 * @param {ISignOption} options 签名参数
 * @param {string} options.dir 目录前缀
 * @param {number} options.maxSize 文件最大尺寸(字节)
 * @param {number} options.expire 过期时间(秒)
 */
signer.sign('filename.jpg');

前端使用方法

参考: http://oss-demo.aliyuncs.com/oss-h5-upload-js-php/index.html

注意:bucket必须设置了Cors(Post打勾),不然没有办法上传

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago