From 2e0eab0d59fd8500849e75282fad517a4b8744ee Mon Sep 17 00:00:00 2001 From: xxq250 Date: Wed, 9 Oct 2024 15:36:18 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20=20=E5=88=A0=E9=99=A4=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=97=B6issue=EF=BC=8Cpr=E7=94=A8=E6=88=B7=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=B7=B2=E6=B3=A8=E9=94=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/avatar_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/avatar_helper.rb b/app/helpers/avatar_helper.rb index b703e1b4e..607e4ce29 100644 --- a/app/helpers/avatar_helper.rb +++ b/app/helpers/avatar_helper.rb @@ -15,9 +15,9 @@ module AvatarHelper if File.exist?(disk_filename(source&.class, source&.id)) ctime = File.ctime(disk_filename(source.class, source.id)).to_i if %w(User Organization).include?(source.class.to_s) - File.join("images", relative_path, ["#{source.class}", "#{source.id}"]) + "?t=#{ctime}" + File.join("images", relative_path, ["#{source.class}", "#{source&.id}"]) + "?t=#{ctime}" else - File.join("images/avatars", ["#{source.class}", "#{source.id}"]) + "?t=#{ctime}" + File.join("images/avatars", ["#{source.class}", "#{source&.id}"]) + "?t=#{ctime}" end elsif source.class.to_s == 'User' source.get_letter_avatar_url