1.0.0 • Published 2 years ago

xy-qiniu v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

安装

NPM

npm install --save xy-qiniu

使用

import Qiniu from 'xy-qiniu'

const options = {}
const store = new Qiniu(options)

Options

名称必填说明
async是否异步获取配置信息,默认 false。如果为 true 时,getConfig 需要返回 Promise 对象
root根目录,默认为空
domain域名,用于获取完整 url
reanme重命名,将文件名重命名为 uuid 格式,默认:true
config配置
config.nextsubscribe 中的 next 函数,查看详细
getConfig动态获取配置信息,async 为 true 时必填,返回一个 Promise 对象
getToken获取token,动态刷新token使用,返回一个 Promise 对象

Methods

.upload('key', 'file' , 'config')

文件上传

依赖

qiniu-js

参考

对象储存