From 0026dfe6160c9b24b30c9e0c29785bab8fde7261 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 11:04:57 +0800 Subject: [PATCH 01/11] =?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/tpm/NewHeader.js | 1 + public/react/src/modules/tpm/TPMBanner.js | 2 +- public/react/src/modules/tpm/newshixuns/Newshixuns.js | 4 +--- public/react/src/modules/tpm/shixuns/css/TPMBanner.css | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 5f7f485f8..c1ad97276 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -738,6 +738,7 @@ submittojoinclass=(value)=>{
  • diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js index 23b228800..5efadc1d1 100644 --- a/public/react/src/modules/tpm/TPMBanner.js +++ b/public/react/src/modules/tpm/TPMBanner.js @@ -597,7 +597,7 @@ class TPMBanner extends Component {
    -
    学员评分
    +
    学员评分
    diff --git a/public/react/src/modules/tpm/newshixuns/Newshixuns.js b/public/react/src/modules/tpm/newshixuns/Newshixuns.js index 184b6313a..956e652c8 100644 --- a/public/react/src/modules/tpm/newshixuns/Newshixuns.js +++ b/public/react/src/modules/tpm/newshixuns/Newshixuns.js @@ -236,9 +236,7 @@ class Newshixuns extends Component { let newshixunUrl = `/shixuns/new.json`; axios.get(newshixunUrl).then((response) => { if (response.status === 200) { - if (response.data.status === 403 || response.data.status === 401 || response.data.status === 500) { - - } else { + if (response.data.message===undefined) { this.setState({ newshixunlist: response.data }); diff --git a/public/react/src/modules/tpm/shixuns/css/TPMBanner.css b/public/react/src/modules/tpm/shixuns/css/TPMBanner.css index 0492f20c3..b3233f641 100644 --- a/public/react/src/modules/tpm/shixuns/css/TPMBanner.css +++ b/public/react/src/modules/tpm/shixuns/css/TPMBanner.css @@ -87,7 +87,7 @@ a:active{text-decoration:none;} #commentsStar{ margin-top: -7px; width: 90px; - margin-bottom: 11px; + } .startbtnModal .ant-modal-content{ background: transparent; From 85bbe35785121a4aecd7f770648128775308fd1c 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 11:29:27 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/coursesPublic/Addcourses.js | 2 +- .../src/modules/paths/PathDetail/DetailCardsEditAndAdd.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/Addcourses.js b/public/react/src/modules/courses/coursesPublic/Addcourses.js index 749e4870c..99b7db945 100644 --- a/public/react/src/modules/courses/coursesPublic/Addcourses.js +++ b/public/react/src/modules/courses/coursesPublic/Addcourses.js @@ -314,7 +314,7 @@ class Addcourses extends Component{ diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js index 6e2ca0883..bfaaaacc7 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js +++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js @@ -140,17 +140,20 @@ class DetailCardsEditAndAdd extends Component{ //打开选择实训弹框初始化tag标签和列表 changeTag=(id,search)=>{ this.setState({ - hometypepvisible:true + hometypepvisible:true, + ChooseShixunListshixun_list:[], + page:1 }) let pathId=this.props.pathid; let {page}=this.state; - let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+page + let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+1 if(search!="" && search!=undefined){ url+="&search="+search; } if(id!=0){ url+="&type="+id; } + axios.get(url).then((result)=>{ if(result.status===200){ this.setState({ From 838d4c67e8732f5e3a0eddb993200695583541c5 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 11:31:55 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/coursesPublic/Addcourses.js | 2 +- public/react/src/modules/tpm/NewHeader.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/Addcourses.js b/public/react/src/modules/courses/coursesPublic/Addcourses.js index 99b7db945..b140508d4 100644 --- a/public/react/src/modules/courses/coursesPublic/Addcourses.js +++ b/public/react/src/modules/courses/coursesPublic/Addcourses.js @@ -314,7 +314,7 @@ class Addcourses extends Component{ diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index c1ad97276..8e48e8b0d 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -737,14 +737,14 @@ submittojoinclass=(value)=>{
    } { 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 08/11] =?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 09/11] =?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 10/11] =?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)=>{