Sloaix / qiniu4js

🔥七牛上传SDK(浏览器环境)
MIT License
162 stars 34 forks source link

Save key #12

Closed kezhuw closed 7 years ago

kezhuw commented 7 years ago

The main purpose of this pr is to add saveKey support with client side magic variable resolution.

Currently three magic variables, which are statement as unsupported in saveKey by Qiniu, are resolved in client side. There are $(uuid), $(imageInfo.width) and $(imageInfo.height).

In order to support saveKey, this pr add support to get token through http get request. This function is compatible with qiniu/js-sdk's uptoken_url.

Additionally, token getting logic was separated and moved from upload patterns to uploader.