1.4.6 • Published 6 years ago

@jzone/cosupload v1.4.6

Weekly downloads
21
License
MIT
Repository
github
Last release
6 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

6 years ago

1.4.5

6 years ago

1.4.4

6 years ago

1.4.3

6 years ago

1.4.2

6 years ago

1.4.1

6 years ago

1.4.0

6 years ago

1.3.5

6 years ago

1.3.3

6 years ago

1.3.2

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago