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

dev_new_shixunsrepository
杨树林 5 years ago
commit dc2e27b6fb

@ -94,9 +94,10 @@ export function initAxiosInterceptors(props) {
requestMap[keyName] = false; requestMap[keyName] = false;
} }
axios.interceptors.request.use( axios.interceptors.request.use(
config => { config => {
config.headers['Content-Type']= 'no-cache'
// if (token) { // 每次发送请求之前判断是否存在token如果存在则统一在http请求的header都加上token不用每次请求都手动添加了 // if (token) { // 每次发送请求之前判断是否存在token如果存在则统一在http请求的header都加上token不用每次请求都手动添加了
// config.headers.Authorization = token; // config.headers.Authorization = token;
// } // }

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

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

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

@ -206,7 +206,7 @@ class ShixunHomeworkPage extends Component {
} }
SaveAppraiseModal=(comment,hidden_comment)=>{ SaveAppraiseModal=(comment,hidden_comment)=>{
let url = `/homework_commons/${this.props.match.params.homeworkid}/batch_comment.jsonr` let url = `/homework_commons/${this.props.match.params.homeworkid}/batch_comment.json`
axios.post(url,{ axios.post(url,{
comment: comment, comment: comment,
hidden_comment: hidden_comment, hidden_comment: hidden_comment,

Loading…
Cancel
Save