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

dev_jupyter
杨树林 5 years ago
commit c154447119

@ -29,7 +29,7 @@ class ApplicationController < ActionController::Base
unless suffix_arr.include?(suffix)
if params[:client_key].present?
randomcode = params[:randomcode]
tip_exception(501, "请求不合理") unless (Time.now.to_i - randomcode.to_i).between?(0,5)
# tip_exception(501, "请求不合理") unless (Time.now.to_i - randomcode.to_i).between?(0,5)
sign = Digest::MD5.hexdigest("#{OPENKEY}#{randomcode}")
Rails.logger.info("2222 #{sign}")

@ -94,9 +94,10 @@ export function initAxiosInterceptors(props) {
requestMap[keyName] = false;
}
axios.interceptors.request.use(
config => {
// config.headers['Content-Type']= 'no-cache'
// if (token) { // 每次发送请求之前判断是否存在token如果存在则统一在http请求的header都加上token不用每次请求都手动添加了
// config.headers.Authorization = token;
// }
@ -137,7 +138,7 @@ export function initAxiosInterceptors(props) {
let newopens=md5(opens+timestamp)
config.url = url;
if (config.url.indexOf('?') == -1) {
config.url = `${config.url}?&randomcode=${timestamp}&client_key=${newopens}`;
config.url = `${config.url}?randomcode=${timestamp}&client_key=${newopens}`;
} else {
config.url = `${config.url}&randomcode=${timestamp}&client_key=${newopens}`;
}

@ -128,7 +128,7 @@ export function getTaskUrlById(id) {
export function getRandomcode(url) {
Railsgettimes()
let anewopens=md5(newopens+newtimestamp);
return `${url}?&randomcode=${newtimestamp}&client_key=${anewopens}`
return `${url}?randomcode=${newtimestamp}&client_key=${anewopens}`
}
export function htmlEncode(str) {

@ -98,7 +98,10 @@ class SingleDisplay extends Component{
// }
if (question_type == 0) { // 单选
return (
<div className="mb10 clearfix" key={optionIndex}>
<div className="mb10 clearfix " style={{
display: "flex",
flexDirection:"row",
}} key={optionIndex}>
<Radio disabled className="fl lineh-25" checked={item.standard_boolean}>{prefix}</Radio>
<MarkdownToHtml content={item.choice_text} selector={'single_' + (index + 1) + '' + (optionIndex + 1)} style={{ float: 'left', display: 'inline-block' }}
@ -109,7 +112,10 @@ class SingleDisplay extends Component{
} else {
return (
<div className="mb10 clearfix" key={optionIndex}>
<div className="mb10 clearfix" style={{
display: "flex",
flexDirection:"row",
}} key={optionIndex}>
<Checkbox disabled className="fl lineh-25 mr8" checked={item.standard_boolean}>{prefix}</Checkbox>
<MarkdownToHtml content={item.choice_text} selector={'single_' + (index + 1)+ '' + (optionIndex + 1)} style={{ float: 'left', display: 'inline-block' }}

@ -112,6 +112,7 @@ class PollDetailTabForth extends Component{
// 已有设置数据的查询
getSettingInfo=()=>{
this.props.getPollInfo();
let pollId=this.props.match.params.pollId;
let url=`/polls/${pollId}/poll_setting.json`;
axios.get(url).then((result)=>{
@ -184,7 +185,6 @@ class PollDetailTabForth extends Component{
}
}
this.props.getPollInfo();
}).catch((error)=>{
console.log(error);
})
@ -443,7 +443,7 @@ class PollDetailTabForth extends Component{
})
}else{
this.setState({
flagPageEdit:true
flagPageEdit:this.props.isAdmin()?true:false
})
}
}

@ -343,6 +343,7 @@ class PollDetailTabForthRules extends Component{
render(){
let {rules,course_group,flagPageEdit}=this.state
let isAdmin=this.props.isAdmin();
console.log(flagPageEdit)
return(
<div className="bor-top-greyE pt20">
<p className="clearfix mb10">
@ -477,7 +478,7 @@ class PollDetailTabForthRules extends Component{
</p>
</div>
{
flagPageEdit ?
flagPageEdit ?this.props.isAdmin()?
<li className="fl pt5">
{rule.p_timeflag===undefined?r > 0&&rule.publish_time===null?<Tooltip title="删除">
<a className="mr20" onClick={()=>this.removeRules(`${r}`)}><i className="iconfont icon-shanchu color-grey-9 font-18"></i></a>
@ -508,7 +509,7 @@ class PollDetailTabForthRules extends Component{
}
<Tooltip title="新增"><a className="mt6" onClick={this.AddRules}><i className="iconfont icon-tianjiafangda color-green font-18"></i></a> </Tooltip>
</li>
:""
:"":""
}
</div>

Loading…
Cancel
Save