From f22503cffa6484ed9f82228894554804f165e084 Mon Sep 17 00:00:00 2001 From: dinglink <837816638@qq.com> Date: Sat, 21 Mar 2020 00:51:36 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/coursesDetail/CoursesBanner.js | 2 ++ .../src/modules/courses/coursesHome/CoursesHomeCard.js | 6 +++--- public/react/src/modules/user/usersInfo/InfosCourse.js | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js index 7e324fadc..180599fa8 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js @@ -617,11 +617,13 @@ class CoursesBanner extends Component {

+

{coursedata.teacher_school}

+ {/*{excellent===false?*/} {/* :*/} diff --git a/public/react/src/modules/courses/coursesHome/CoursesHomeCard.js b/public/react/src/modules/courses/coursesHome/CoursesHomeCard.js index c021c07e7..004781ec0 100644 --- a/public/react/src/modules/courses/coursesHome/CoursesHomeCard.js +++ b/public/react/src/modules/courses/coursesHome/CoursesHomeCard.js @@ -94,12 +94,12 @@ class CoursesHomeCard extends Component{

-
+
{item.teacher_users.length===0?'': - 协作老师: + 协作老师: {item.teacher_users.map((iem,idx)=>{ return( - {iem} + {idx<3?iem:''} ) }) } diff --git a/public/react/src/modules/user/usersInfo/InfosCourse.js b/public/react/src/modules/user/usersInfo/InfosCourse.js index 4913588b2..d2510d8a2 100644 --- a/public/react/src/modules/user/usersInfo/InfosCourse.js +++ b/public/react/src/modules/user/usersInfo/InfosCourse.js @@ -346,9 +346,9 @@ class InfosCourse extends Component{ 用户

{item.teacher && item.teacher.real_name}

{item&&item.school}

-
+
{item.teacher_users.length===0?'': - 协作老师: + 协作老师: {item.teacher_users.map((iem,idx)=>{ return( {iem} From 646f1b12807ee5c4f7632bf478ee4d2f0a646816 Mon Sep 17 00:00:00 2001 From: anke1460 Date: Sun, 22 Mar 2020 18:04:53 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=BC=A9=E5=B0=91=E5=9C=A8=E7=BA=BF?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=97=B6=E9=97=B4=E8=8C=83=E5=9B=B4=EF=BC=8C?= =?UTF-8?q?=E6=8F=90=E9=AB=98=E7=BB=9F=E8=AE=A1=E7=B2=BE=E7=A1=AE=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/libs/user_online.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/libs/user_online.rb b/app/libs/user_online.rb index 8db5754f3..6276b3fd4 100644 --- a/app/libs/user_online.rb +++ b/app/libs/user_online.rb @@ -11,7 +11,7 @@ module UserOnline def set_bit(user_id, flag) if !Rails.cache.data.exists(cache_key) Rails.cache.data.setbit(cache_key, user_id, flag) - Rails.cache.data.expire(cache_key, 20 * 60 + 10) + Rails.cache.data.expire(cache_key, 2 * 60 + 10) else Rails.cache.data.setbit(cache_key, user_id, flag) end @@ -27,11 +27,11 @@ module UserOnline def cache_key if Rails.cache.is_a?(ActiveSupport::Cache::RedisStore) - # 10分钟为一段记录用户在线, 统计范围为20分钟内的线用户 + # 如设置2分钟内即120秒有请求的用户视为在线, 则最大会统计到4分钟内有活动用户 # TODO 更精确时长 begin_hour = Time.now.beginning_of_hour - minutes_piece = (Time.now - begin_hour) / 600 - time = begin_hour.since((minutes_piece.to_i - 1) * 600).strftime("%H-%M") + minutes_piece = (Time.now - begin_hour) / 120 + time = begin_hour.since((minutes_piece.to_i - 1) * 120).strftime("%H-%M") "online_user_#{time}" else raise '请配置config.cache_store = redis_store'