0.0.4 • Published 1 year ago

@wpsz/uni-upload v0.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

万能上传器

兼容 AWS、天翼云、七牛云、华为云上传

install

yarn

调试

`

yarn dev

`

发布

`

npm publish

`

使用

yarn add @wpsz/uni-upload

`

const observable = uniUpload(file.value, {

storage: 'qiniu',

appid: 'pcchat',

token: 'xxxxx',

key:'/dir/xxxx/filename'

config: {

​ bucket: 'wptalk',

​ fileDomain: 'https://wptalk.wpstatic.cn',

​ apiDomain: '',

​ apiSecret: 'Zcn368HknN5Z2-R7tj7PH7q26H8jLk8hYtnK6_cO',

​ yunMode: 1,

},

})

const observer = {

next(res) {

​ precent.value = res.total

},

async error(err) {

​ console.error(err)

},

complete(res) {

​ console.log(res)

},

}

// 开始上传

observable.subscribe(observer)

`