兼容 AWS、天翼云、七牛云、华为云上传
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)
`