React Native Qiniu SDK
纯JavaScript实现的Qiniu SDK,修改rpc下的七牛直传文件方法 可以获得七牛上传后的返回值
安装
npm i react-native-qiniu-upload --save
使用方法
;ConfACCESS_KEY = <AK>ConfSECRET_KEY = <SK>//强烈不建议在客户端保存 AK 和 SK ,反编译后 hacker 获取到可以对你的资源为所欲为,建议通过安全渠道从服务器端获取。 //upload file to Qiniuvar putPolicy = scope: "<Bucket>:<Key>";var uptoken = putPolicy;let formInput = key : "<Key>" // formInput对象如何配置请参考七牛官方文档“直传文件”一节Rpc; //download private filevar getPolicy = ;let url = getPolicy;//fetch from this url //image sync operationvar imgInfo = 1100200;let url = imgInfo;//fetch from this url //image info var self = this;var imgInfo = ;let url = imgInfo;; //resource operation//stat infovar self = this;Rs ;
进行中
Release Note
0.1.0
- 上传文件
- 私有库中文件下载功能
- Image Ops
- 资源管理
0.1.1
- 重构 upload 方法 (CaveyChan)
0.2.0
- es6 style
Contributor
- CaveyChan
- laukey