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/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/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] 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/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: '请输入最小人数和最大人数' - }], + // }], })(
diff --git a/public/react/src/modules/courses/gradinforms/Bullsubdirectory.js b/public/react/src/modules/courses/gradinforms/Bullsubdirectory.js
index 3e7522e31..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(
- 基于项目实施 + 不基于项目 (无需在平台创建项目,任意小组成员均可以提交作品)
:"" 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(); } 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) &&