From 1cea71dd07fd9d183fcbbf87e0c534b146768f94 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 23 Jul 2019 11:18:35 +0800 Subject: [PATCH 01/17] 1440 --- public/react/src/modules/tpm/TPMIndexHOC.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/TPMIndexHOC.js b/public/react/src/modules/tpm/TPMIndexHOC.js index 2beb9fa1b..e092c17d4 100644 --- a/public/react/src/modules/tpm/TPMIndexHOC.js +++ b/public/react/src/modules/tpm/TPMIndexHOC.js @@ -302,11 +302,12 @@ export function TPMIndexHOC(WrappedComponent) {
+ {/* 注释掉了1440 影响到了手机屏幕的展示 */} -
@@ -298,7 +299,7 @@ class PathModal extends Component{ }) } -
+
} { this.state.patheditarrytype===true?{this.state.patheditarryvalue}:""}
取消 diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js index e47fe5a0f..fc0a0fea9 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js +++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js @@ -142,11 +142,15 @@ class DetailCardsEditAndAdd extends Component{ //打开选择实训弹框初始化tag标签和列表 changeTag=(id,search)=>{ - this.setState({ - hometypepvisible:true, - }) - let pathId=this.props.pathid; - let {page}=this.state; + + this.setState({ + ChooseShixunListshixun_list:[], + page:1, + hometypepvisible:true, + }) + + let pathId=this.props.pathid; + let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+1 if(search!="" && search!=undefined){ url+="&search="+search; @@ -157,11 +161,6 @@ class DetailCardsEditAndAdd extends Component{ axios.get(url).then((result)=>{ if(result.status===200){ - this.setState({ - ChooseShixunListshixun_list:[], - page:1 - }) - this.setState({ ChooseShixunList:result.data, hometypepvisible:false, @@ -296,11 +295,10 @@ class DetailCardsEditAndAdd extends Component{ contentViewScrolladd=(e)=>{ - let {page}=this.state; //滑动到底判断 if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ // console.log("到达底部"); - if(page!=1){ + debugger this.setState({ hometypepvisible:true }) @@ -334,7 +332,7 @@ class DetailCardsEditAndAdd extends Component{ }).catch((error)=>{ console.log(error); }) - } + } @@ -493,7 +491,7 @@ class DetailCardsEditAndAdd extends Component{ ` } -
@@ -520,7 +518,7 @@ class DetailCardsEditAndAdd extends Component{ }) } -
+
}
取消 确定 diff --git a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js index 72bbbe3d0..ed1249f0d 100644 --- a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js +++ b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js @@ -392,10 +392,12 @@ export default class TPMsettings extends Component { let departmentsUrl = `/shixuns/departments.json`; axios.get(departmentsUrl).then((response) => { if (response.status === 200) { - this.setState({ - departmentslist: response.data.shools_name - }); - } + if (response.data.message === undefined) { + this.setState({ + departmentslist: response.data.shools_name + }); + } + } }).catch((error) => { console.log(error) }); diff --git a/public/react/src/modules/tpm/newshixuns/Newshixuns.js b/public/react/src/modules/tpm/newshixuns/Newshixuns.js index 956e652c8..cb0f08c0f 100644 --- a/public/react/src/modules/tpm/newshixuns/Newshixuns.js +++ b/public/react/src/modules/tpm/newshixuns/Newshixuns.js @@ -251,9 +251,11 @@ class Newshixuns extends Component { let departmentsUrl = `/shixuns/departments.json`; axios.get(departmentsUrl).then((response) => { if (response.status === 200) { - this.setState({ - departmentslist: response.data.shools_name - }); + if (response.data.message===undefined) { + this.setState({ + departmentslist: response.data.shools_name + }); + } } }).catch((error) => { console.log(error) @@ -496,7 +498,9 @@ class Newshixuns extends Component { function fake() { let departmentsUrl = `/shixuns/departments.json?q=` + currentValue; axios.get(departmentsUrl).then((response) => { - callback(response.data.shools_name); + if (response.data.message===undefined) { + callback(response.data.shools_name); + } }).catch((error) => { console.log(error) }); From 5cf824022a36c4b27789b97d933efda877a9ee89 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Tue, 23 Jul 2019 12:12:03 +0800 Subject: [PATCH 10/17] =?UTF-8?q?=E6=8E=88=E6=9D=83=E8=AE=A4=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 33 +++++++++++++++++------ 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index b0183574d..28fec46af 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -186,15 +186,32 @@ class ApplicationController < ActionController::Base # 系统全局认证 def check_auth - if current_user.certification != 1 && current_user.apply_actions.exists?(container_type: 'TrialAuthorization', status: 0) - tip_exception(408, "您的试用申请正在审核中,请耐心等待") - elsif current_user.certification != 1 - day_cer = UserDayCertification.find_by(user_id: current_user.id) - tip_exception(407, "系统未授权") unless (Time.now.to_i - day_cer.try(:created_at).to_i) < 86400 - elsif !current_user.profile_completed? - info_url = '/account/profile' - tip_exception(402, info_url) + day_cer = UserDayCertification.find_by(user_id: current_user.id) + # 如果注册超过24小时则需要完善资料及授权 + if (Time.now.to_i - day_cer.try(:created_at).to_i) > 86400 + if !current_user.profile_completed? + info_url = '/account/profile' + tip_exception(402, info_url) + elsif current_user.certification != 1 + if current_user.apply_actions.exists?(container_type: 'TrialAuthorization', status: 0) + tip_exception(408, "您的试用申请正在审核中,请耐心等待") + end + tip_exception(407, "系统未授权") + end end + + + # if current_user.certification != 1 && current_user.apply_actions.exists?(container_type: 'TrialAuthorization', status: 0) + # tip_exception(408, "您的试用申请正在审核中,请耐心等待") + # elsif (Time.now.to_i - day_cer.try(:created_at).to_i) < 86400 + # if !current_user.profile_completed? + # info_url = '/account/profile' + # tip_exception(402, info_url) + # elsif current_user.certification != 1 + # day_cer = UserDayCertification.find_by(user_id: current_user.id) + # tip_exception(407, "系统未授权") unless (Time.now.to_i - day_cer.try(:created_at).to_i) < 86400 + # end + # end end def start_user_session(user) From aefe7a8fa2813d4a34a706e1e63e389a94c6a78a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 23 Jul 2019 12:12:47 +0800 Subject: [PATCH 11/17] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/new/CoursesNew.js | 28 +++++++++++-------- public/react/src/modules/tpm/NewHeader.js | 8 +++--- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js index eb1627e83..a8f50b030 100644 --- a/public/react/src/modules/courses/new/CoursesNew.js +++ b/public/react/src/modules/courses/new/CoursesNew.js @@ -290,11 +290,13 @@ class CoursesNew extends Component { search:value }).then((result)=>{ // console.log(result.data) - this.setState({ - searchlist:result.data.course_lists, - // course:value, - fetching:false - }) + if (response.data.message===undefined) { + this.setState({ + searchlist: result.data.course_lists, + // course:value, + fetching: false + }) + } // this.props.form.setFieldsValue({ // course:value // }) @@ -343,13 +345,15 @@ class CoursesNew extends Component { search: value } }).then((result)=>{ - this.setState({ - searchlistscholl:result.data.school_names, - scholl:value - }) - this.props.form.setFieldsValue({ - scholl:value - }) + if (response.data.message===undefined) { + this.setState({ + searchlistscholl: result.data.school_names, + scholl: value + }) + this.props.form.setFieldsValue({ + scholl: value + }) + } }).catch((error)=>{ console.log(error) }) diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 8e48e8b0d..28de997cd 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -534,10 +534,10 @@ submittojoinclass=(value)=>{
- {/**/} +
{/*<%= link_to image_tag("/images/educoder/logo.png", alt:"高校智能化教学与实训平台", className:"logoimg"), home_path %>*/} From 6966a475f026a709193e22b098b6a15ef9d99c43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 23 Jul 2019 12:18:04 +0800 Subject: [PATCH 12/17] =?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/AppConfig.js | 7 ++++--- public/react/src/modules/login/LoginDialog.js | 5 +++-- public/react/src/modules/tpm/NewHeader.js | 6 +++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 0cc9fd687..5721c88a9 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -18,9 +18,10 @@ function locationurl(list){ } // TODO 开发期多个身份切换 -const debugType =window.location.search.indexOf('debug=t') != -1 ? 'teacher' : - window.location.search.indexOf('debug=s') != -1 ? 'student' : 'admin' -window._debugType = debugType; +const debugType ="" +// window.location.search.indexOf('debug=t') != -1 ? 'teacher' : +// window.location.search.indexOf('debug=s') != -1 ? 'student' : 'admin' +// window._debugType = debugType; export function initAxiosInterceptors(props) { // TODO 避免重复的请求 https://github.com/axios/axios#cancellation diff --git a/public/react/src/modules/login/LoginDialog.js b/public/react/src/modules/login/LoginDialog.js index d587dc337..54fe17b9f 100644 --- a/public/react/src/modules/login/LoginDialog.js +++ b/public/react/src/modules/login/LoginDialog.js @@ -392,11 +392,12 @@ class LoginDialog extends Component { } return ( - this.handleDialogClose()} > + {isRender===true?
{this.handleDialogClose()}}> @@ -489,7 +490,7 @@ class LoginDialog extends Component {
- + :""}
); diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 28de997cd..2455b0be4 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -534,12 +534,12 @@ submittojoinclass=(value)=>{
- + />:""} -
+
{/*<%= link_to image_tag("/images/educoder/logo.png", alt:"高校智能化教学与实训平台", className:"logoimg"), home_path %>*/} 高校智能化教学与实训平台 From 32fa240e08d4f0ead379b8bf50e525af6dfeadcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 23 Jul 2019 12:23:24 +0800 Subject: [PATCH 13/17] b --- public/react/src/modules/courses/new/CoursesNew.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js index a8f50b030..136e50d6e 100644 --- a/public/react/src/modules/courses/new/CoursesNew.js +++ b/public/react/src/modules/courses/new/CoursesNew.js @@ -290,7 +290,7 @@ class CoursesNew extends Component { search:value }).then((result)=>{ // console.log(result.data) - if (response.data.message===undefined) { + if (result.data.message===undefined) { this.setState({ searchlist: result.data.course_lists, // course:value, @@ -345,7 +345,7 @@ class CoursesNew extends Component { search: value } }).then((result)=>{ - if (response.data.message===undefined) { + if (result.data.message===undefined) { this.setState({ searchlistscholl: result.data.school_names, scholl: value From d1965d5251df19c3d61fe876b1d17411836a435a Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 23 Jul 2019 12:52:15 +0800 Subject: [PATCH 14/17] 407 --- .../react/src/modules/paths/PathDetail/PathDetailIndex.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js index 6843f678a..bb410c1ce 100644 --- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js +++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js @@ -139,7 +139,9 @@ class PathDetailIndex extends Component{ let pathid=this.props.match.params.pathId; let url="/paths/"+pathid+".json"; axios.get(url).then((result)=>{ - + if (result.data.status == 407) { + return; + } if(result.data.allow_visit===true){ this.setState({ detailInfoList:result.data, @@ -162,6 +164,9 @@ class PathDetailIndex extends Component{ let pathid=this.props.match.params.pathId; let url="/paths/"+pathid+".json"; axios.get(url).then((result)=>{ + if (result.data.status == 407) { + return; + } if(result.data.allow_visit===true){ this.setState({ detailInfoList:result.data, From b85cca3d19ea2fd9bbfbf19d4a47307868fbe163 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 23 Jul 2019 13:05:54 +0800 Subject: [PATCH 15/17] null --- .../react/src/modules/courses/shixunHomework/shixunHomework.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/shixunHomework/shixunHomework.js b/public/react/src/modules/courses/shixunHomework/shixunHomework.js index 3a4efc17d..78ee31e82 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunHomework.js +++ b/public/react/src/modules/courses/shixunHomework/shixunHomework.js @@ -1137,7 +1137,7 @@ class ShixunHomework extends Component{ `} {/*onChange={this.onCheckBoxChange} value={checkBoxValues}*/} {datas===undefined?"": - { datas.homeworks.map((item, index) => { + { datas.homeworks && datas.homeworks.map((item, index) => { // console.log("ShixunhomeWorkItem") // console.log("++++++++++++++++++++++++++++++++++++++++++") // console.log(JSON.stringify(this.props)) From a30134783d12fc1a3d2783b46bcc9dcc7e2bbd43 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 23 Jul 2019 13:10:22 +0800 Subject: [PATCH 16/17] null --- public/react/src/modules/courses/coursesPublic/Addcourses.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/react/src/modules/courses/coursesPublic/Addcourses.js b/public/react/src/modules/courses/coursesPublic/Addcourses.js index 886ba2a0e..914a82c6d 100644 --- a/public/react/src/modules/courses/coursesPublic/Addcourses.js +++ b/public/react/src/modules/courses/coursesPublic/Addcourses.js @@ -89,6 +89,7 @@ class Addcourses extends Component{ }) }else{ this.setState({ + professor:null, assistant_professor:null, Checkboxteacherchecked:e.target.checked, Checkboxteachingtype:false From f1eb51c1d5b3ad311826554498ba541ede4f424b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 23 Jul 2019 13:25:17 +0800 Subject: [PATCH 17/17] =?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/AppConfig.js | 7 ++--- .../courses/coursesPublic/Addcourses.js | 30 ++++++++++++++----- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 5721c88a9..8cca8205f 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -18,10 +18,9 @@ function locationurl(list){ } // TODO 开发期多个身份切换 -const debugType ="" -// window.location.search.indexOf('debug=t') != -1 ? 'teacher' : -// window.location.search.indexOf('debug=s') != -1 ? 'student' : 'admin' -// window._debugType = debugType; +const debugType =window.location.search.indexOf('debug=t') != -1 ? 'teacher' : + window.location.search.indexOf('debug=s') != -1 ? 'mfp2guqj3' : 'admin' +window._debugType = debugType; export function initAxiosInterceptors(props) { // TODO 避免重复的请求 https://github.com/axios/axios#cancellation diff --git a/public/react/src/modules/courses/coursesPublic/Addcourses.js b/public/react/src/modules/courses/coursesPublic/Addcourses.js index 914a82c6d..b7d46eac6 100644 --- a/public/react/src/modules/courses/coursesPublic/Addcourses.js +++ b/public/react/src/modules/courses/coursesPublic/Addcourses.js @@ -117,7 +117,7 @@ class Addcourses extends Component{ hidetojoinclass=()=>{ - + let {Addcoursestype}=this.props; // console.log(this.props) this.setState({ invite_code:undefined, @@ -132,11 +132,16 @@ class Addcourses extends Component{ student:null, Addcoursestypes:false }) - this.props.hideAddcoursestype(); + + if(Addcoursestype===true){ + this.props.hideAddcoursestype(); + } + } submitasyn=(course_id)=>{ - let{professor}=this.state; + let{professor,Addcoursestype}=this.state; + if(professor===1){ this.setState({ loadtype:true, @@ -145,13 +150,17 @@ class Addcourses extends Component{ modalSave:(course_id)=>this.submitasyns(course_id), Addcoursestype:false }) - this.props.hideAddcoursestype(); + if(Addcoursestype===true){ + this.props.hideAddcoursestype(); + } }else{ // let{course_id}=this.state; this.setState({ Addcoursestype:false }) - this.props.hideAddcoursestype(); + if(Addcoursestype===true){ + this.props.hideAddcoursestype(); + } window.location.href ="/courses/"+course_id+"/students"; } @@ -161,6 +170,7 @@ class Addcourses extends Component{ } submittojoinclass=()=>{ + let{Addcoursestype}=this.state; this.setState({ isSpin:true }) @@ -207,7 +217,9 @@ class Addcourses extends Component{ message:"提示", description:response.data.message }); - this.props.hideAddcoursestype(); + if(Addcoursestype===true){ + this.props.hideAddcoursestype(); + } // this.props.showNotification(response.data.message); @@ -220,7 +232,9 @@ class Addcourses extends Component{ this.setState({ Addcoursestype:false }) - this.props.hideAddcoursestype(); + if(Addcoursestype===true){ + this.props.hideAddcoursestype(); + } // this.setState({ @@ -318,7 +332,7 @@ class Addcourses extends Component{ keyboard={false} className={"HomeworkModal"} title="加入课堂" - visible={Addcoursestype===undefined?Addcoursestypes:Addcoursestype} + visible={Addcoursestype===undefined||Addcoursestype===false?Addcoursestypes:Addcoursestype} closable={false} footer={null} destroyOnClose={true}