From 40bf50d9dac161d40c034e2369d40b0eac69669f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 7 Sep 2019 15:59:09 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=89=88=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/groupjobbank/GroupPackage2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/groupjobbank/GroupPackage2.js b/public/react/src/modules/courses/groupjobbank/GroupPackage2.js index f6fa8361a..7f593c353 100644 --- a/public/react/src/modules/courses/groupjobbank/GroupPackage2.js +++ b/public/react/src/modules/courses/groupjobbank/GroupPackage2.js @@ -89,7 +89,7 @@ class GroupPackage extends Component {

:datas&&datas.group_info&&datas.group_info.base_on_project===0?

- 基于项目实施 + 不基于项目 (无需在平台创建项目,任意小组成员均可以提交作品)

:"" From d151ce46bb27742cea0be5731e587d4d7c99f631 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 7 Sep 2019 16:06:29 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E5=85=AC=E5=91=8A=E6=A0=8F=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/gradinforms/Bullsubdirectory.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/gradinforms/Bullsubdirectory.js b/public/react/src/modules/courses/gradinforms/Bullsubdirectory.js index 3e7522e31..4f77f976f 100644 --- a/public/react/src/modules/courses/gradinforms/Bullsubdirectory.js +++ b/public/react/src/modules/courses/gradinforms/Bullsubdirectory.js @@ -239,10 +239,13 @@ class Bullsubdirectory extends Component{
{ - this.props.isClassManagement() === true ? + this.props.isAdmin() === true ? (this.props.yslbool===false? - + + 编辑 +
}> this.bianji(true)}> + : "" ) @@ -251,10 +254,13 @@ class Bullsubdirectory extends Component{ { - this.props.isClassManagement() === true ? + this.props.isAdmin() === true ? (this.props.yslbool===false? - + + 删除 + }> this.setModeltrue(true)}> + : "" ) From 220820a31317790f41e3c0d8415ab90d0a29f857 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 7 Sep 2019 16:12:46 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E5=85=AC=E5=91=8A=E6=A0=8F=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/gradinforms/Bullsubdirectory.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/gradinforms/Bullsubdirectory.js b/public/react/src/modules/courses/gradinforms/Bullsubdirectory.js index 4f77f976f..ae77b0cf3 100644 --- a/public/react/src/modules/courses/gradinforms/Bullsubdirectory.js +++ b/public/react/src/modules/courses/gradinforms/Bullsubdirectory.js @@ -216,7 +216,9 @@ class Bullsubdirectory extends Component{ let{description,whethertoeditysl,addonAfter,eduintits,informs,isSpinysl} =this.state; let{myname,mydescription,id}=this.props; const {getFieldDecorator} = this.props.form; - + console.log("Bullsubdirectory"); + console.log(this.props.isAdmin()); + console.log(this.props.yslbool); return(
From 1295cb3607279ae86345eca7bf4624e5aabb10df Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 7 Sep 2019 16:19:06 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E9=A2=98=E5=BA=93=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users/question_banks_controller.rb | 5 +++-- config/routes.rb | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/controllers/users/question_banks_controller.rb b/app/controllers/users/question_banks_controller.rb index 5c8e69a29..c5b837d0b 100644 --- a/app/controllers/users/question_banks_controller.rb +++ b/app/controllers/users/question_banks_controller.rb @@ -1,11 +1,12 @@ class Users::QuestionBanksController < Users::BaseController before_action :require_login - before_action :private_user_resources! + skip_before_action :check_observed_user_exists! + # before_action :private_user_resources! before_action :check_query_params! before_action :check_user_permission! def index - service = Users::QuestionBankService.new(observed_user, query_params) + service = Users::QuestionBankService.new(User.current, query_params) question_banks = service.call @count = question_banks.count diff --git a/config/routes.rb b/config/routes.rb index 0d1b979b1..5cf74c29a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -55,12 +55,14 @@ Rails.application.routes.draw do get :homepage_info end + get :question_banks, on: :collection, to: 'users/question_banks#index' + scope module: :users do resources :courses, only: [:index] resources :shixuns, only: [:index] resources :projects, only: [:index] resources :subjects, only: [:index] - resources :question_banks, only: [:index] + # resources :question_banks, only: [:index] resource :experience_records, only: [:show] resource :grade_records, only: [:show] resource :watch, only: [:create, :destroy] From 1adc4e507f7d458f046e32b194a87230cd7bd538 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Sat, 7 Sep 2019 16:30:12 +0800 Subject: [PATCH 5/7] react help pages add title --- config/initializers/session_extenstions.rb | 35 ------------------- public/react/src/modules/help/AboutUs.js | 1 + public/react/src/modules/help/Agreement.js | 1 + public/react/src/modules/help/ContactUs.js | 1 + public/react/src/modules/help/Cooperatives.js | 1 + public/react/src/modules/help/Feedback.js | 4 +++ public/react/src/modules/help/HelpCenter.js | 1 + 7 files changed, 9 insertions(+), 35 deletions(-) delete mode 100644 config/initializers/session_extenstions.rb diff --git a/config/initializers/session_extenstions.rb b/config/initializers/session_extenstions.rb deleted file mode 100644 index 36a8ae8c7..000000000 --- a/config/initializers/session_extenstions.rb +++ /dev/null @@ -1,35 +0,0 @@ -#coding=utf-8 - -module SessionExtenstions - - module EntryExtension - def compressed? - @compressed - end - - def value - if @value - begin - Marshal.load(compressed? ? Zlib::Inflate.inflate(@value) : @value) - rescue TypeError - compressed? ? Zlib::Inflate.inflate(@value) : @value - end - end - end - - def size - if @value.nil? - 0 - else - @value.bytesize - end - end - end - - -end - -ActiveSupport::Cache::Entry.const_set("DEFAULT_COMPRESS_LIMIT", 1) -ActiveSupport::Cache::Entry.send(:prepend, SessionExtenstions::EntryExtension) - - diff --git a/public/react/src/modules/help/AboutUs.js b/public/react/src/modules/help/AboutUs.js index 85e8366c0..06198418c 100644 --- a/public/react/src/modules/help/AboutUs.js +++ b/public/react/src/modules/help/AboutUs.js @@ -16,6 +16,7 @@ class AboutUs extends React.Component { } componentDidMount(){ + window.document.title = "关于我们"; this.getContent(); } diff --git a/public/react/src/modules/help/Agreement.js b/public/react/src/modules/help/Agreement.js index c9a778360..4e483b719 100644 --- a/public/react/src/modules/help/Agreement.js +++ b/public/react/src/modules/help/Agreement.js @@ -16,6 +16,7 @@ class Agreement extends React.Component { } componentDidMount(){ + window.document.title = "服务协议"; this.getContent(); } diff --git a/public/react/src/modules/help/ContactUs.js b/public/react/src/modules/help/ContactUs.js index 00cb7b880..04e3404fe 100644 --- a/public/react/src/modules/help/ContactUs.js +++ b/public/react/src/modules/help/ContactUs.js @@ -17,6 +17,7 @@ class ContactUs extends React.Component { } componentDidMount(){ + window.document.title = "联系我们"; this.getData(); } diff --git a/public/react/src/modules/help/Cooperatives.js b/public/react/src/modules/help/Cooperatives.js index dbc0ffc4b..b64657488 100644 --- a/public/react/src/modules/help/Cooperatives.js +++ b/public/react/src/modules/help/Cooperatives.js @@ -21,6 +21,7 @@ class Cooperatives extends React.Component { } componentDidMount(){ + window.document.title = "合作伙伴"; this.getCooperatives(); } diff --git a/public/react/src/modules/help/Feedback.js b/public/react/src/modules/help/Feedback.js index d8a94bea9..c7f13f809 100644 --- a/public/react/src/modules/help/Feedback.js +++ b/public/react/src/modules/help/Feedback.js @@ -13,6 +13,10 @@ class Feedback extends React.Component { super(props); } + componentDidMount() { + window.document.title = "意见反馈"; + } + componentDidUpdate(prevProps) { if (prevProps.current_user !== this.props.current_user) { if(!this.props.checkIfLogin()) { diff --git a/public/react/src/modules/help/HelpCenter.js b/public/react/src/modules/help/HelpCenter.js index 86cce49ce..077f4b90e 100644 --- a/public/react/src/modules/help/HelpCenter.js +++ b/public/react/src/modules/help/HelpCenter.js @@ -16,6 +16,7 @@ class HelpCenter extends React.Component { } componentDidMount(){ + window.document.title = "帮助中心"; this.getContent(); } From 7559b342263b700e813f0e8b387a5c46c0343583 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Sat, 7 Sep 2019 16:30:22 +0800 Subject: [PATCH 6/7] err --- public/react/src/modules/courses/busyWork/NewWorkForm.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/NewWorkForm.js b/public/react/src/modules/courses/busyWork/NewWorkForm.js index 1626c5c6a..f5d4d9eb4 100644 --- a/public/react/src/modules/courses/busyWork/NewWorkForm.js +++ b/public/react/src/modules/courses/busyWork/NewWorkForm.js @@ -100,6 +100,7 @@ class NewWorkForm extends Component{ const courseId = this.state.course_id || this.props.match.params.coursesId ; this.props.form.validateFieldsAndScroll((err, values) => { + if(err && err.personNum) delete err.personNum; console.log(values) const mdContnet = this.contentMdRef.current.getValue().trim(); console.log(mdContnet) @@ -135,7 +136,7 @@ class NewWorkForm extends Component{ } // const errKeys = Object.keys(err); // || errKeys.length == 1 && errKeys[0] == 'content' && mdContnet - if (!err) { + if (!err || Object.keys(err).length == 0) { if (this.state.isEdit) { this.doEdit(courseId, values) } else { @@ -451,12 +452,12 @@ class NewWorkForm extends Component{ > {getFieldDecorator('personNum', { validateTrigger: 'onNone', - rules: [{ + // rules: [{ // required: true, // message: '人数不能为空' // validator: this.personNumValidator // required: true, message: '请输入最小人数和最大人数' - }], + // }], })(

From 1cd5e2dc9a2ecc0d33d57839ef28bd48834f6be2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 7 Sep 2019 16:39:24 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E9=A2=98=E5=BA=93=E6=9D=83=E9=99=90?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/config/webpack.config.prod.js | 2 +- .../src/modules/user/usersInfo/InfosBanner.js | 6 +- .../src/modules/user/usersInfo/InfosCourse.js | 2 +- .../src/modules/user/usersInfo/InfosTopics.js | 110 ++++++++---------- 4 files changed, 54 insertions(+), 66 deletions(-) diff --git a/public/react/config/webpack.config.prod.js b/public/react/config/webpack.config.prod.js index d5ad7593a..8cab0465f 100644 --- a/public/react/config/webpack.config.prod.js +++ b/public/react/config/webpack.config.prod.js @@ -62,7 +62,7 @@ module.exports = { // We generate sourcemaps in production. This is slow but gives good results. // You can exclude the *.map files from the build during deployment. // devtool: shouldUseSourceMap ? 'nosources-source-map' : false, //正式版 - devtool: shouldUseSourceMap ? 'source-map' : 'source-map',//测试版 + devtool: shouldUseSourceMap ? 'source-map' : false,//测试版 // In production, we only want to load the polyfills and the app code. entry: [require.resolve('./polyfills'), paths.appIndexJs], output: { diff --git a/public/react/src/modules/user/usersInfo/InfosBanner.js b/public/react/src/modules/user/usersInfo/InfosBanner.js index 99afce1d0..4e6492c7f 100644 --- a/public/react/src/modules/user/usersInfo/InfosBanner.js +++ b/public/react/src/modules/user/usersInfo/InfosBanner.js @@ -31,8 +31,8 @@ class InfosBanner extends Component{ let user_type=this.props.current_user&&this.props.current_user.user_identity; let targetuserid=this.props.data&&this.props.data.id; - // console.log(is_current) - // console.log(current_user) + // console.log(is_current) + // console.log(current_user) // console.log(current_user.is_teacher) // console.log(current_user.admin) return( @@ -124,7 +124,7 @@ class InfosBanner extends Component{ } {/*自己的主页且不是学生显示题库按钮*/} - {((is_current && current_user && current_user.is_teacher ) || current_user && current_user.admin) + {(is_current && current_user) &&

  • this.setState({moduleName: 'topics'})} diff --git a/public/react/src/modules/user/usersInfo/InfosCourse.js b/public/react/src/modules/user/usersInfo/InfosCourse.js index 0f6abc61b..f90b35d09 100644 --- a/public/react/src/modules/user/usersInfo/InfosCourse.js +++ b/public/react/src/modules/user/usersInfo/InfosCourse.js @@ -103,7 +103,7 @@ class InfosCourse extends Component{ } = this.state; let is_current=this.props.is_current; - console.log(this.props.current_user&&this.props.current_user.user_identity==="学生") + // console.log(this.props.current_user&&this.props.current_user.user_identity==="学生") return(
    diff --git a/public/react/src/modules/user/usersInfo/InfosTopics.js b/public/react/src/modules/user/usersInfo/InfosTopics.js index 5b344270e..8da80aad3 100644 --- a/public/react/src/modules/user/usersInfo/InfosTopics.js +++ b/public/react/src/modules/user/usersInfo/InfosTopics.js @@ -31,33 +31,34 @@ class InfosTopics extends Component{ } componentDidMount(){ - let types=this.props.match.params.topicstype; - let professional_certification=this.props.current_user&&this.props.current_user.professional_certification; - - if(professional_certification===false&&types==="publicly"){ - this.setState({ - isshowprofes:true - }) - }else{ - this.updataslist() - } - } - componentDidUpdate(prevProps) { - - if(prevProps.current_user!=this.props.current_user){ - let types=this.props.match.params.topicstype; - let professional_certification=this.props.current_user&&this.props.current_user.professional_certification; - - console.log(professional_certification) - if(professional_certification===false&&types==="publicly"){ - this.setState({ - isshowprofes:true - }) - }else{ - this.updataslist() - } - } + // let types=this.props.match.params.topicstype; + // let professional_certification=this.props.current_user&&this.props.current_user.professional_certification; + // + // if(professional_certification===false&&types==="publicly"){ + // this.setState({ + // isshowprofes:true + // }) + // }else{ + // this.updataslist() + // } + this.updataslist() } + // componentDidUpdate(prevProps) { + // + // if(prevProps.current_user!=this.props.current_user){ + // let types=this.props.match.params.topicstype; + // let professional_certification=this.props.current_user&&this.props.current_user.professional_certification; + // + // console.log(professional_certification) + // if(professional_certification===false&&types==="publicly"){ + // this.setState({ + // isshowprofes:true + // }) + // }else{ + // this.updataslist() + // } + // } + // } updataslist=()=>{ let types=this.props.match.params.topicstype; let { category,course_list_id,sort_by,sort_direction,page}=this.state; @@ -65,39 +66,12 @@ class InfosTopics extends Component{ } searchAlldata=(type,category,course_list_id,sort_by,sort_direction,page)=>{ - // if(this.props.current_user.login!=this.props.match.params.username){ - // return - // }else{ - // - // } - - let types=this.props.match.params.topicstype; - let professional_certification=this.props.current_user&&this.props.current_user.professional_certification; - - - if(professional_certification===false&&types==="publicly"){ - - }else{ this.setState({ isSpin:true }) - let types=this.props.match.params.topicstype; - let user_id=""; - - if(types==="publicly"){ - user_id=this.props.current_user&&this.props.current_user.login; - }else{ - user_id=this.props.match.params&&this.props.match.params.username; - } - - - if(user_id===undefined){ - user_id=1 - } - let {per_page}=this.state; - let url=`/users/${user_id}/question_banks.json`; + let url=`/users/question_banks.json`; axios.get(encodeURI(url),{params:{ type, @@ -109,19 +83,33 @@ class InfosTopics extends Component{ per_page } }).then((response) => { - this.setState({ - data:response.data, - checkBoxValues:[], - isSpin:false - }) + if(response){ + if(response.status){ + if(response.data.status == -2){ + this.setState({ + isshowprofes:true, + isSpin:false + }) + }else if(response.data.status === 403||response.data.status === 401||response.data.status === 500){ + this.setState({ + isSpin:false + }) + }else{ + this.setState({ + data:response.data, + checkBoxValues:[], + isSpin:false + }) + } + } + } + }).catch((error) => { this.setState({ isSpin:false }) }); - } - } searchCategory=(type)=>{