0.0.0 • Published 7 years ago

tiny-qiniu-request v0.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

tiny-qiniu-request

tiny-qiniu for rc-upload or antd upload component customRequest property.

Installation

yarn add tiny-qiniu tiny-qiniu-request

Usage

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}
        />
    }
}
Signature

tinyQiniuRequest(option)

The option usage is the same with tiny-qiniu constructor option

Related Projects

License

MIT