From 38c2061d8b6a4d2435ba91558b342e987f6bcffa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 26 Jul 2019 18:29:06 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/login/LoginDialog.js | 5 +--- .../modules/user/LoginRegisterComponent.js | 22 +++++++------- .../react/src/modules/user/Notcompletedysl.js | 30 +++++++++++-------- 3 files changed, 30 insertions(+), 27 deletions(-) diff --git a/public/react/src/modules/login/LoginDialog.js b/public/react/src/modules/login/LoginDialog.js index a4dee4b4c..50038366d 100644 --- a/public/react/src/modules/login/LoginDialog.js +++ b/public/react/src/modules/login/LoginDialog.js @@ -367,10 +367,7 @@ class LoginDialog extends Component { description:response.data.message, }); }else{ - if(response.data.profile_completed !== null || response.data.profile_completed === false){ - this.setMyEduCoderModals(); - return; - } + broadcastChannelPostMessage('refreshPage') this.setState({ diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index 9b1533bea..9006dc64c 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -340,10 +340,10 @@ class LoginRegisterComponent extends Component { } - if(response.data.profile_completed !== null || response.data.profile_completed === false){ - this.setMyEduCoderModals(); - return; - } + // if(response.data.profile_completed !== null || response.data.profile_completed === false){ + // this.setMyEduCoderModals(); + // return; + // } if (response.status === 200) { if (response.data.status === 402) { @@ -458,13 +458,13 @@ class LoginRegisterComponent extends Component { return; } }else { - this.setState({ - logins: "", - dragOk: false, - codes: "", - passwords: "", - Agreetotheterms: "", - }) + // this.setState({ + // logins: "", + // dragOk: false, + // codes: "", + // passwords: "", + // Agreetotheterms: "", + // }) this.setMyEduCoderModals(); } } diff --git a/public/react/src/modules/user/Notcompletedysl.js b/public/react/src/modules/user/Notcompletedysl.js index f9c260209..e15a118ff 100644 --- a/public/react/src/modules/user/Notcompletedysl.js +++ b/public/react/src/modules/user/Notcompletedysl.js @@ -16,19 +16,25 @@ class Notcompletedysl extends Component { // console.log("Notcompletedysl"); // console.log("开发了402了"); - axios.interceptors.response.use((response) => { - // console.log(response); - if (response != undefined) - if (response && response.data.status === 402) { - this.setState({ - modalsType: true - }) - } - return response; - }, (error) => { - //TODO 这里如果样式变了会出现css不加载的情况 + if(this.props.modalsType!=undefined){ + this.setState({ + modalsType:this.props.modalsType + }) + } - }); + // axios.interceptors.response.use((response) => { + // // console.log(response); + // if (response != undefined) + // if (response && response.data.status === 402) { + // this.setState({ + // modalsType: true + // }) + // } + // return response; + // }, (error) => { + // //TODO 这里如果样式变了会出现css不加载的情况 + // + // }); } From a5e1645c38e797315f0dd4c91d6ca33481e640f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 26 Jul 2019 18:37:07 +0800 Subject: [PATCH 2/6] b --- public/react/src/modules/user/LoginRegisterComponent.js | 4 ++-- public/react/src/modules/user/Notcompletedysl.js | 8 +------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index 9006dc64c..3f54149bf 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -1038,10 +1038,10 @@ class LoginRegisterComponent extends Component { :
} - {this.setNotcompleteds()}} - /> + />:""} { Whethertoverify===false&&pciphone===true? diff --git a/public/react/src/modules/user/Notcompletedysl.js b/public/react/src/modules/user/Notcompletedysl.js index e15a118ff..fc70f838e 100644 --- a/public/react/src/modules/user/Notcompletedysl.js +++ b/public/react/src/modules/user/Notcompletedysl.js @@ -16,12 +16,6 @@ class Notcompletedysl extends Component { // console.log("Notcompletedysl"); // console.log("开发了402了"); - if(this.props.modalsType!=undefined){ - this.setState({ - modalsType:this.props.modalsType - }) - } - // axios.interceptors.response.use((response) => { // // console.log(response); // if (response != undefined) @@ -61,7 +55,7 @@ class Notcompletedysl extends Component { destroyOnClose={true} title="提示" centered={true} - visible={this.state.modalsType} + visible={this.props.modalsType} width="530px" >
From d77a383a57394685e427b4433bf29ebd4c97457f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 26 Jul 2019 18:50:33 +0800 Subject: [PATCH 3/6] b --- .../courses/coursesDetail/CoursesBanner.js | 27 +++++++++++++++++-- public/react/src/modules/tpm/NewHeader.js | 20 ++++++++++++-- 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js index cc3646b9d..afe7b606a 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js @@ -4,6 +4,7 @@ import axios from 'axios'; import {getImageUrl, trigger, on, off} from 'educoder'; import { Tooltip, message,Popover} from 'antd'; import CoursesListType from '../coursesPublic/CoursesListType'; +import AccountProfile from"../../user/AccountProfile"; import Addcourses from '../coursesPublic/Addcourses'; import '../css/Courses.css'; import Modals from "../../modals/Modals"; @@ -88,6 +89,13 @@ class CoursesBanner extends Component { } tojoinclass = (val) => { + if(this.props.current_user&&this.props.current_user.profile_completed===false){ + this.setState({ + AccountProfiletype:true + }) + return + } + if (val === 1) { this.setState({ Addcoursestypes: true, @@ -326,15 +334,30 @@ class CoursesBanner extends Component { postsettings=()=>{ window.location.href = "/courses/" + this.props.match.params.coursesId + "/settings"; } + + + hideAccountProfile=()=>{ + this.setState({ + AccountProfiletype:false + }) + } + render() { - let { Addcoursestypes, coursedata, modalsType, modalsTopval, loadtype,modalsBottomval,antIcon,is_guide} = this.state; + let { Addcoursestypes, coursedata, modalsType, modalsTopval, loadtype,modalsBottomval,antIcon,is_guide,AccountProfiletype} = this.state; return (
{ is_guide && } - + + {AccountProfiletype===true?this.hideAccountProfile()} + {...this.state} + {...this.props} + />:""} + + { coursedata === undefined || coursedata.status===401?
:
diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index e0eb5d02b..b89d59fe7 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -182,7 +182,15 @@ class NewHeader extends Component { }) return; } - this.setState({ + + if(user&&user.profile_completed===false){ + this.setState({ + AccountProfiletype:true + }) + return; + } + + this.setState({ Addcoursestypes:true, }) } @@ -201,7 +209,15 @@ class NewHeader extends Component { }) return; } - this.setState({ + + if(user&&user.profile_completed===false){ + this.setState({ + AccountProfiletype:true + }) + return; + } + + this.setState({ tojoinitemtype:true }) } From ae1f2a01f10a12062c3e520daa74464aa455d552 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 26 Jul 2019 18:57:52 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/paths/PathDetail/DetailCards.js | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/paths/PathDetail/DetailCards.js b/public/react/src/modules/paths/PathDetail/DetailCards.js index fc75961ec..3c159782a 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCards.js +++ b/public/react/src/modules/paths/PathDetail/DetailCards.js @@ -1,14 +1,14 @@ import React, { Component } from 'react'; import {getImageUrl} from 'educoder'; import {Tooltip,Modal,Icon,Spin,message} from 'antd'; -import '../../paths/ShixunPaths.css'; import DetailCardsEditAndAdd from './DetailCardsEditAndAdd'; import DetailCardsEditAndEdit from './DetailCardsEditAndEdit'; +import AccountProfile from"../user/AccountProfile"; import { BrowserRouter as Router, Route, Link } from "react-router-dom"; import axios from 'axios'; import { DragDropContext , Draggable, Droppable} from 'react-beautiful-dnd'; import Modals from '../../modals/Modals'; - +import '../../paths/ShixunPaths.css'; const $ = window.$ // // //a little function to help us with reordering the result @@ -193,7 +193,12 @@ class DetailCards extends Component{ } startgameid=(id)=>{ - + 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) => { @@ -292,10 +297,16 @@ class DetailCards extends Component{ startshixunCombattype:false }) } - render(){ + hideAccountProfile=()=>{ + this.setState({ + AccountProfiletype:false + }) + } + + render(){ let { pathCardsList, dropid, - dropidtype, + AccountProfiletype, idsum, pathCardsedittype, pathlistedit, @@ -317,6 +328,12 @@ class DetailCards extends Component{ return(
+ {AccountProfiletype===true?this.hideAccountProfile()} + {...this.state} + {...this.props} + />:""} + Date: Fri, 26 Jul 2019 19:00:13 +0800 Subject: [PATCH 5/6] b --- public/react/src/modules/paths/PathDetail/DetailCards.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/paths/PathDetail/DetailCards.js b/public/react/src/modules/paths/PathDetail/DetailCards.js index 3c159782a..19894e856 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCards.js +++ b/public/react/src/modules/paths/PathDetail/DetailCards.js @@ -3,7 +3,7 @@ import {getImageUrl} from 'educoder'; import {Tooltip,Modal,Icon,Spin,message} from 'antd'; import DetailCardsEditAndAdd from './DetailCardsEditAndAdd'; import DetailCardsEditAndEdit from './DetailCardsEditAndEdit'; -import AccountProfile from"../user/AccountProfile"; +import AccountProfile from"../../user/AccountProfile"; import { BrowserRouter as Router, Route, Link } from "react-router-dom"; import axios from 'axios'; import { DragDropContext , Draggable, Droppable} from 'react-beautiful-dnd'; From 56d7f26f51cf39afbbc22361736fae556a2bf6a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 26 Jul 2019 19:16:34 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/shixunHomework/ShixunStudentWork.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js index 0c808e01d..4bb44b697 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js @@ -23,7 +23,8 @@ import { Radio, Tooltip, notification, - Pagination + Pagination, + Spin, } from "antd"; import {Link, Switch, Route, Redirect} from 'react-router-dom'; import axios from 'axios'; @@ -653,7 +654,7 @@ class ShixunStudentWork extends Component { ) } - + const antIcon = ; return (
{this.state.showmodel===true?
  • + - 正在执行查重,请稍后刷新页面查看结果 温馨提示:执行时间因查重作品数以及作品的代码量而异 + 正在执行查重,完成后将为您自动刷新结果。 温馨提示:执行时间因查重作品数以及作品的代码量而异