tiny-qiniu for rc-upload or antd upload component customRequest
property.
yarn add tiny-qiniu tiny-qiniu-request
tiny-qiniu-request
should work together with rc-upload or antd upload component
import React, { Component } from 'react';
import { Upload } from 'antd';
import tinyQiniuRequest from 'tiny-qiniu-request';
const request = tinyQiniuRequest({
name: 'my_bucket', // qiniu bucket name, requried
domain: 'http://cdn.awesome.com', // qiniu bucket domain, requried
uptokenUrl: 'http://localhost/api/uptoken',
});
export default class MyUpload extends {
render() {
<Upload
customRequest={request}
// {...other}
/>
}
}
tinyQiniuRequest(option)
The option
usage is the same with tiny-qiniu constructor option
MIT