获取头像 omniauth discord Ruby on Rails

问题描述

在我的 user.rb 中,我尝试保存指向头像的链接:

def self.from_omniauth(auth)
where(provider: auth.provider,uid: auth.uid).first_or_create do |user|
user.provider = auth.provider
user.uid = auth.uid
user.email = auth.info.email
user.password = Devise.friendly_token[0,20]
user.image = auth.info.image
end

它适用于 omniauth-google-oauth2,但不和谐我只得到图像 src 的一半。例如:

https://cdn.discordapp.com/avatars/714396517990037405/

其中 /714396517990037405/ 是用户 ID,缺少图像名称

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)