diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index c09a2cbe7..174b163d8 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -20,16 +20,16 @@ let hashTimeout // TODO 开发期多个身份切换 let debugType ="" -if (isDev) { - const _search = window.location.search; - let parsed = {}; - if (_search) { - parsed = queryString.parse(_search); - } - debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : - window.location.search.indexOf('debug=s') != -1 ? 'student' : - window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' -} +// if (isDev) { +// const _search = window.location.search; +// let parsed = {}; +// if (_search) { +// parsed = queryString.parse(_search); +// } +// debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : +// window.location.search.indexOf('debug=s') != -1 ? 'student' : +// window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' +// } window._debugType = debugType; export function initAxiosInterceptors(props) { diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index 565121e1b..490bb1283 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -75,10 +75,15 @@ class ShixunWorkReport extends Component { let homeworkid=this.props.match.params.homeworkid; let url = `/student_works/${homeworkid}/shixun_work_report.json` axios.get(url).then((result) => { + if (result.data.status === 403||result.data.status === 401||result.data.status === 407||result.data.status === 408) { + + }else{ this.setState({ data:result.data, spinning:false }) + } + }).catch((error) => { console.log(error) this.setState({ @@ -111,6 +116,8 @@ class ShixunWorkReport extends Component { } render() { let{data} =this.state; + console.log(data) + console.log(this.props) let category_id=data===undefined?"":data.category===null?"":data.category.category_id; let homework_common_id=data===undefined?"":data.homework_common_id; let homeworkid=this.props.match.params.homeworkid; diff --git a/public/react/src/modules/paths/PathDetail/DetailCards.js b/public/react/src/modules/paths/PathDetail/DetailCards.js index 21165ff57..1dd93daa8 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCards.js +++ b/public/react/src/modules/paths/PathDetail/DetailCards.js @@ -193,12 +193,20 @@ class DetailCards extends Component{ } startgameid=(id)=>{ + + if(this.props.checkIfLogin()===false){ + this.props.showLoginDialog() + return + } + if(this.props.current_user&&this.props.current_user.profile_completed===false){ this.setState({ AccountProfiletype:true }) return } + + let url = "/shixuns/" + id + "/shixun_exec.json"; axios.get(url).then((response) => { diff --git a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js index 36537e7d0..1d233a775 100644 --- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js +++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js @@ -326,6 +326,15 @@ class PathDetailIndex extends Component{ return(