图片怎么转base64?(已解决)
为什么这样转出来的不对呢。
const opts = {
url: 'http://www.coolaf.com/static/img/s.png'
}
var [err, response] = yield request.get(opts)
var base64 = Buffer.from(response.bod, 'binary').toString('base64')
之前答案就在眼前竟然没点开。。。汗 解决方法
11 回复
你给出来那张图片 http://www.coolaf.com/static/img/s.png 有一个 301 跳转到 http://coolaf.com/static/img/s.png,你是否处理了?