From b23704a9660043ade4a4073c706cbc65ca9764c9 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 24 Jul 2019 14:08:07 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E9=83=A8=E9=97=A8=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/department.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/models/department.rb b/app/models/department.rb index bf5c3a90e..c019862db 100644 --- a/app/models/department.rb +++ b/app/models/department.rb @@ -3,8 +3,7 @@ class Department < ApplicationRecord has_many :department_members, dependent: :destroy - after_create_commit :reset_data_cache - after_update_commit :reset_data_cache + after_commit :reset_data_cache def self.cached_names_data(school) Rails.cache.fetch(names_data_cache_key(school.id), expires_in: 7.days) do @@ -16,9 +15,7 @@ class Department < ApplicationRecord def reset_data_cache # 清除部门名称缓存 - if new_record? || name_previously_changed? - Rails.cache.delete(self.class.names_data_cache_key(school_id)) - end + Rails.cache.delete(self.class.names_data_cache_key(school_id)) end def self.names_data_cache_key(school_id) From d3eee68c74f7fafe9bce2c033efefa0223a64772 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Wed, 24 Jul 2019 14:08:18 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/user/Interestpage.js | 6 +++--- public/react/src/modules/user/InterestpageMax.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/public/react/src/modules/user/Interestpage.js b/public/react/src/modules/user/Interestpage.js index 4c3c39406..b3abfe1a4 100644 --- a/public/react/src/modules/user/Interestpage.js +++ b/public/react/src/modules/user/Interestpage.js @@ -258,15 +258,15 @@ class InterestpageComponent extends Component {
选择你可能感兴趣的内容
diff --git a/public/react/src/modules/user/InterestpageMax.js b/public/react/src/modules/user/InterestpageMax.js index 82b3e7e0f..a53c1bbe0 100644 --- a/public/react/src/modules/user/InterestpageMax.js +++ b/public/react/src/modules/user/InterestpageMax.js @@ -260,15 +260,15 @@ class InterestpageMax extends Component {