FIX code bug

This commit is contained in:
jasder 2021-04-20 19:06:31 +08:00
parent 45f05c9fc4
commit 002c773746
1 changed files with 3 additions and 2 deletions

View File

@ -14,9 +14,10 @@ class User
avatar_path(self.username, size).split('public/')&.last
end
def self.get_letter_avatar_url(name, size = :lg)
def self.get_letter_avatar_url(name)
return "" if name.blank?
avatar_path(Pinyin.t(name), size).split('public/')&.last
avatar = LetterAvatar.generate Pinyin.t(name), 120
avatar.split('public/')&.last
end
def avatar_path(username, size)