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

chromesetting
cxt 5 years ago
commit 230fe521e4

@ -103,3 +103,6 @@ gem 'diffy'
# oauth2 # oauth2
gem 'omniauth', '~> 1.9.0' gem 'omniauth', '~> 1.9.0'
gem 'omniauth-oauth2', '~> 1.6.0' gem 'omniauth-oauth2', '~> 1.6.0'
# global var
gem 'request_store'

@ -303,7 +303,7 @@ class ApplicationController < ActionController::Base
current_domain_session = session[:"#{default_yun_session}"] current_domain_session = session[:"#{default_yun_session}"]
if current_domain_session if current_domain_session
# existing session # existing session
(User.active.find(current_domain_session) rescue nil) User.current = (User.active.find(current_domain_session) rescue nil)
elsif autologin_user = try_to_autologin elsif autologin_user = try_to_autologin
autologin_user autologin_user
elsif params[:format] == 'atom' && params[:key] && request.get? && accept_rss_auth? elsif params[:format] == 'atom' && params[:key] && request.get? && accept_rss_auth?

@ -38,12 +38,20 @@ class Laboratory < ApplicationRecord
find_by_identifier(subdomain) find_by_identifier(subdomain)
end end
def self.current=(laboratory) # def self.current=(laboratory)
Thread.current[:current_laboratory] = laboratory # Thread.current[:current_laboratory] = laboratory
# end
#
# def self.current
# Thread.current[:current_laboratory] ||= Laboratory.find(1)
# end
def self.current=(user)
RequestStore.store[:current_laboratory] = user
end end
def self.current def self.current
Thread.current[:current_laboratory] ||= Laboratory.find(1) RequestStore.store[:current_laboratory] ||= User.anonymous
end end
def shixuns def shixuns

@ -540,12 +540,20 @@ class User < ApplicationRecord
mail.present? mail.present?
end end
# def self.current=(user)
# Thread.current[:current_user] = user
# end
#
# def self.current
# Thread.current[:current_user] ||= User.anonymous
# end
def self.current=(user) def self.current=(user)
Thread.current[:current_user] = user RequestStore.store[:current_user] = user
end end
def self.current def self.current
Thread.current[:current_user] ||= User.anonymous RequestStore.store[:current_user] ||= User.anonymous
end end
def self.anonymous def self.anonymous

@ -205,15 +205,16 @@ class CommonWorkItem extends Component{
{item.uncommit_count===undefined?"":<span className="mr20 fl">{item.uncommit_count} 未交</span>} {item.uncommit_count===undefined?"":<span className="mr20 fl">{item.uncommit_count} 未交</span>}
{ {
item.status_time!="" && item.status_time!="" &&
<Tooltip placement="bottom" title={ item.status.indexOf('提交中') != -1 ? '提交剩余时间' :
item.status.indexOf('补交中') != -1 ? '补交剩余时间' :
item.status.indexOf('申诉中') != -1 ? '申诉剩余时间' :
item.status.indexOf('匿评中') != -1 ? '匿评剩余时间' :
item.status.indexOf('匿评申诉中') != -1 ? '匿评申诉剩余时间' : ''}>
<span className="mr20 fl">{item.status_time}</span> <span className="mr20 fl">{item.status_time}</span>
</Tooltip>
}
}
{/*<Tooltip placement="bottom" title={ item.status.indexOf('提交中') != -1 ? '提交剩余时间' :*/}
{/* item.status.indexOf('补交中') != -1 ? '补交剩余时间' :*/}
{/* item.status.indexOf('申诉中') != -1 ? '申诉剩余时间' :*/}
{/* item.status.indexOf('匿评中') != -1 ? '匿评剩余时间' :*/}
{/* item.status.indexOf('匿评申诉中') != -1 ? '匿评申诉剩余时间' : ''}>*/}
{/*</Tooltip>*/}
{isAdmin && <div className="fr"> {isAdmin && <div className="fr">
<WordsBtn style="blue" className="fl font-16 ml28" onClick={ () => { this.props.toEditPage(this.props.match.params, item.homework_id) }}>编辑</WordsBtn> <WordsBtn style="blue" className="fl font-16 ml28" onClick={ () => { this.props.toEditPage(this.props.match.params, item.homework_id) }}>编辑</WordsBtn>
<WordsBtn style="blue" className="fl font-16 ml28" onClick={ () => { this.props.toWorkSettingPage(this.props.match.params, item.homework_id) }}>设置</WordsBtn> <WordsBtn style="blue" className="fl font-16 ml28" onClick={ () => { this.props.toWorkSettingPage(this.props.match.params, item.homework_id) }}>设置</WordsBtn>

@ -366,10 +366,10 @@ class ShixunWorkReport extends Component {
<p className=" fl color-black mt25 summaryname">{data&&data.shixun_name}</p> <p className=" fl color-black mt25 summaryname">{data&&data.shixun_name}</p>
{/*{this.props.isAdmin()?<a className=" fr font-14 ml30 mt10 mr20 color-grey-9 ">导出实训报告数据</a>:""}*/} {/*{this.props.isAdmin()?<a className=" fr font-14 ml30 mt10 mr20 color-grey-9 ">导出实训报告数据</a>:""}*/}
<a onClick={this.goback} className="color-grey-6 fr font-14 ml20 mt15">返回</a> <a onClick={this.goback} className="color-grey-6 fr font-14 ml20 mt15">返回</a>
{this.props.isAdmin() ? <a <a
className=" color-blue font-14 fr ml20 mt15" className=" color-blue font-14 fr ml20 mt15"
onClick={()=>this.confirmysl(`/student_works/${homeworkid}/export_shixun_work_report.pdf`)} onClick={()=>this.confirmysl(`/student_works/${homeworkid}/export_shixun_work_report.pdf`)}
> <Spin size="small" spinning={this.state.isspinning}>导出实训报告数据</Spin></a> : ""} > <Spin size="small" spinning={this.state.isspinning}>导出实训报告数据</Spin></a>
{/*{this.props.isAdmin() ?work_comment_hidden===true? "":<a*/} {/*{this.props.isAdmin() ?work_comment_hidden===true? "":<a*/}
{/*className=" color-blue font-14 fr ml20 mt15"*/} {/*className=" color-blue font-14 fr ml20 mt15"*/}
{/*onClick={()=>this.showAppraiseModal(1)}*/} {/*onClick={()=>this.showAppraiseModal(1)}*/}

@ -393,21 +393,13 @@ class ShixunhomeWorkItem extends Component{
{ {
discussMessage.time_status===1? discussMessage.time_status===1?
<Tooltip title={"提交剩余时间"} placement="bottom">
<span className="mr15 color-grey9">{discussMessage.status_time}</span> <span className="mr15 color-grey9">{discussMessage.status_time}</span>
</Tooltip>
:discussMessage.time_status===2? :discussMessage.time_status===2?
<Tooltip title={"补交剩余时间"} placement="bottom">
<span className="mr15 color-grey9">{discussMessage.status_time}</span> <span className="mr15 color-grey9">{discussMessage.status_time}</span>
</Tooltip>
:discussMessage.time_status===3? :discussMessage.time_status===3?
<Tooltip title={"匿评剩余时间"} placement="bottom">
<span className="mr15 color-grey9">{discussMessage.status_time}</span> <span className="mr15 color-grey9">{discussMessage.status_time}</span>
</Tooltip>
:discussMessage.time_status===4? :discussMessage.time_status===4?
<Tooltip title={"申诉剩余时间"} placement="bottom">
<span className="mr15 color-grey9">{discussMessage.status_time}</span> <span className="mr15 color-grey9">{discussMessage.status_time}</span>
</Tooltip>
: :
<span className="mr15 color-grey9">{discussMessage.status_time}</span> <span className="mr15 color-grey9">{discussMessage.status_time}</span>
} }

Loading…
Cancel
Save