Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

schedule_job
cxt 5 years ago
commit 9659bb4ce2

@ -11,7 +11,7 @@ module UserOnline
def set_bit(user_id, flag) def set_bit(user_id, flag)
if !Rails.cache.data.exists(cache_key) if !Rails.cache.data.exists(cache_key)
Rails.cache.data.setbit(cache_key, user_id, flag) 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 else
Rails.cache.data.setbit(cache_key, user_id, flag) Rails.cache.data.setbit(cache_key, user_id, flag)
end end
@ -27,11 +27,11 @@ module UserOnline
def cache_key def cache_key
if Rails.cache.is_a?(ActiveSupport::Cache::RedisStore) if Rails.cache.is_a?(ActiveSupport::Cache::RedisStore)
# 10分钟为一段记录用户在线, 统计范围为20分钟内的线用户 # 如设置2分钟内即120秒有请求的用户视为在线, 则最大会统计到4分钟内有活动用户
# TODO 更精确时长 # TODO 更精确时长
begin_hour = Time.now.beginning_of_hour begin_hour = Time.now.beginning_of_hour
minutes_piece = (Time.now - begin_hour) / 600 minutes_piece = (Time.now - begin_hour) / 120
time = begin_hour.since((minutes_piece.to_i - 1) * 600).strftime("%H-%M") time = begin_hour.since((minutes_piece.to_i - 1) * 120).strftime("%H-%M")
"online_user_#{time}" "online_user_#{time}"
else else
raise '请配置config.cache_store = redis_store' raise '请配置config.cache_store = redis_store'

@ -617,11 +617,13 @@ class CoursesBanner extends Component {
</p> </p>
</div> </div>
<div className="fl mt13"> <div className="fl mt13">
<p className="color-white bannnerusernames">{coursedata.teacher_school}</p> <p className="color-white bannnerusernames">{coursedata.teacher_school}</p>
</div> </div>
</div> </div>
{/*{excellent===false?*/} {/*{excellent===false?*/}
{/* :*/} {/* :*/}

@ -94,12 +94,12 @@ class CoursesHomeCard extends Component{
</Tooltip> </Tooltip>
</p> </p>
<div style={{height:30,overflow: 'hidden',textOverflow:'ellipsis',whiteSpace: 'nowrap'}}> <div className="mb15 task-hide mt10" style={{height:20}}>
{item.teacher_users.length===0?'': {item.teacher_users.length===0?'':
<span className="color-grey-98" style={{height:30,display:'flex'}}>协作老师 <span className="color-grey-98" >协作老师
{item.teacher_users.map((iem,idx)=>{ {item.teacher_users.map((iem,idx)=>{
return( return(
<span v-if={idx<3} style={{marginLeft:5}}>{iem} </span> <span className="mb15 task-hide mt10" style={{width:50,marginLeft:5}}>{idx<3?iem:''} </span>
) )
}) })
} }

@ -346,9 +346,9 @@ class InfosCourse extends Component{
<span><img alt="用户" className="radius mt15" height="50" src={getImageUrl('images/'+`${item.teacher && item.teacher.avatar_url}`)} width="50"/></span> <span><img alt="用户" className="radius mt15" height="50" src={getImageUrl('images/'+`${item.teacher && item.teacher.avatar_url}`)} width="50"/></span>
<p className="font-14 mt10 task-hide"><span>{item.teacher && item.teacher.real_name}</span></p> <p className="font-14 mt10 task-hide"><span>{item.teacher && item.teacher.real_name}</span></p>
<p className="font-16 mb15 task-hide mt10"><span className="color-grey-98">{item&&item.school}</span></p> <p className="font-16 mb15 task-hide mt10"><span className="color-grey-98">{item&&item.school}</span></p>
<div style={{height:20,overflow: 'hidden',textOverflow:'ellipsis',whiteSpace: 'nowrap',marginBottom:5}}> <div className="task-hide" style={{height:20,marginBottom:10}}>
{item.teacher_users.length===0?'': {item.teacher_users.length===0?'':
<span className="color-grey-98" style={{height:30,display:'flex'}}>协作老师 <span className="color-grey-98">协作老师
{item.teacher_users.map((iem,idx)=>{ {item.teacher_users.map((iem,idx)=>{
return( return(
<span v-if={idx<3} style={{marginLeft:5}}>{iem} </span> <span v-if={idx<3} style={{marginLeft:5}}>{iem} </span>

Loading…
Cancel
Save