huacnlee / carrierwave-aliyun

阿里云 OSS Ruby 上传组件,基于 Carrierwave
https://huacnlee.com/carrierwave-aliyun/
197 stars 93 forks source link

Be compatible wit the aliyun-sdk 0.7.0 #72

Closed qwlong closed 4 years ago

qwlong commented 4 years ago

Be compatible wit the aliyun-sdk 0.7.0

huacnlee commented 4 years ago

说明一下兼容的原因,解决什么问题

qwlong commented 4 years ago

@huacnlee

The gem invokes the object_url like: img_client.object_url([path, thumb].join(""), expiry: 15.minutes)

aliyun-sdk <= 0.6.0 The object_url method is def object_url(key, sign = true, expiry = 60)

https://github.com/aliyun/aliyun-oss-ruby-sdk/blob/0.6.0/lib/aliyun/oss/bucket.rb#L593

aliyun-sdk >= 0.7.0

The object_url method is def object_url(key, sign = true, expiry = 60, parameters = {}) https://github.com/aliyun/aliyun-oss-ruby-sdk/blob/v0.7.1/lib/aliyun/oss/bucket.rb#L594

说明一下兼容的原因,解决什么问题

huacnlee commented 4 years ago

为何不升级 0.7.0?

实在没精力兼容那么多版本,你们项目如果不是必须要依赖 0.6.0 的话,你可以升级一下 bundle update aliyun-sdk

另外,实际上我忘了为了更新支持到 aliyun-sdk 0.7.0 了

qwlong commented 4 years ago

换了 aliyun-sdk 以后就有问题,参数调用方式是: img_client.object_url([path, thumb].join(""), expiry: 15.minutes)

实际上是这个method是: def object_url(key, sign = true, expiry = 60, parameters = {})

对于private的bucket 增加?x-oss-process=image/ 参数有影响,生成的URL不对