1.4.6 • Published 4 years ago

@jzone/cosupload v1.4.6

Weekly downloads
21
License
MIT
Repository
github
Last release
4 years ago

@jzone/cosupload

tencent-cos的二次封装,可根据入参决定用固定Secret或tmpSecret

安装

# Using yarn
yarn add @jzone/cosupload
# tag
yarn add @jzone/cosupload@1.3.0
# Using npm
npm install @jzone/cosupload
# tag
npm install @jzone/cosupload@1.3.0

使用

固定SecretId、SecretKey

import COS from '@jzone/cosupload'

const UploadFileInstance = new UploadFile({
  SecretId: 'xxx',
  SecretKey: 'xxx',
  Bucket: 'xxx',
  Region: 'xxx',
  defaultBasePath: '', // 次级目录 默认年/月/日
})

UploadFileInstance.upload({
  file: 'test', // 文件或字符串
  basePath: '', // 顶级目录
  success: data => console.warn(data)
})

临时SecretId、SecretKey

import COS from '@jzone/cosupload'

const UploadFileInstance = new UploadFile({
  Bucket: 'xxx',
  Region: 'xxx',
  defaultBasePath: '', // 次级目录 默认年/月/日
  tmpSecretUrl: 'xxx', // 获取tmpSecret相关信息的接口,接口返回结构{ data:{credentials, expiredTime } } })

UploadFileInstance.upload({
  file: 'test', // 文件或字符串
  basePath: '', // 顶级目录
  success: data => console.warn(data)
})

发布

 # base
 yarn prod

 # tag
 yarn prod tag
1.4.6

4 years ago

1.4.5

4 years ago

1.4.4

4 years ago

1.4.3

4 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.5

4 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago