From 2598cd12d8072f706ddbbeb1d2ce27576b1538a0 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Tue, 24 Sep 2019 11:25:55 +0800 Subject: [PATCH 1/2] use ctime to fix image cache --- app/helpers/application_helper.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index d889de36d..dbdcaea40 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -126,10 +126,11 @@ module ApplicationHelper # 用户图像url,如果不存在的话,source为匿名用户,即默认使用匿名用户图像 def url_to_avatar(source) if File.exist?(disk_filename(source.class, source.id)) + ctime = File.ctime(disk_filename(source.class, source.id)).to_i if source.class.to_s == 'User' - File.join(relative_path, ["#{source.class}", "#{source.id}"]) + File.join(relative_path, ["#{source.class}", "#{source.id}"]) + "?t=#{ctime}" else - File.join("images/avatars", ["#{source.class}", "#{source.id}"]) + File.join("images/avatars", ["#{source.class}", "#{source.id}"]) + "?t=#{ctime}" end elsif source.class.to_s == 'User' str = source.user_extension.try(:gender).to_i == 0 ? "b" : "g" From 8e0b067b691d2141e0d91e5e1edee81486580b89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 24 Sep 2019 14:00:36 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../graduation/tasks/GraduateTaskItem.js | 2 +- .../shixunHomework/ShixunhomeWorkItem.js | 2 +- .../src/modules/user/usersInfo/InfosCourse.js | 21 ++++++++++++------- .../src/modules/user/usersInfo/InfosTopics.js | 2 +- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js b/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js index d45b7d60f..ef16e06a4 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js @@ -249,7 +249,7 @@ class GraduateTaskItem extends Component{
-

+

{/* {discussMessage.author.name} */} diff --git a/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js b/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js index f2d873f82..b56993b08 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js @@ -329,7 +329,7 @@ class ShixunhomeWorkItem extends Component{

-

+

{/* {discussMessage.author.name} */} { discussMessage.author && {discussMessage.author} } diff --git a/public/react/src/modules/user/usersInfo/InfosCourse.js b/public/react/src/modules/user/usersInfo/InfosCourse.js index f90b35d09..c733900d7 100644 --- a/public/react/src/modules/user/usersInfo/InfosCourse.js +++ b/public/react/src/modules/user/usersInfo/InfosCourse.js @@ -163,6 +163,13 @@ class InfosCourse extends Component{

+ {item.visits>0? + + {item.visits} + + + :""} + { item.members_count > 0 && @@ -177,13 +184,13 @@ class InfosCourse extends Component{ {item.homework_commons_count} } - { - item.attachments_count > 0 && - - - {item.attachments_count} - - } + {/*{*/} + {/*item.attachments_count > 0 && */} + {/**/} + {/**/} + {/*{item.attachments_count}*/} + {/**/} + {/*}*/}
diff --git a/public/react/src/modules/user/usersInfo/InfosTopics.js b/public/react/src/modules/user/usersInfo/InfosTopics.js index f9525487e..76979c9f5 100644 --- a/public/react/src/modules/user/usersInfo/InfosTopics.js +++ b/public/react/src/modules/user/usersInfo/InfosTopics.js @@ -541,7 +541,7 @@ class InfosTopics extends Component{
-

+

{types==="publicly"?{item.creator_name}:""} {item.quotes_count} 次引用