From 3db9ac825adb255881d7fc4532e4e7f9600c2141 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, 3 Jan 2020 23:36:47 +0800 Subject: [PATCH 1/3] =?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/page/main/CodeEvaluateView.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/page/main/CodeEvaluateView.js b/public/react/src/modules/page/main/CodeEvaluateView.js index e70d02008..346b8797e 100644 --- a/public/react/src/modules/page/main/CodeEvaluateView.js +++ b/public/react/src/modules/page/main/CodeEvaluateView.js @@ -318,6 +318,7 @@ class CodeEvaluateView extends Component { */ const _arrowClasses = isCollapse ? 'iconfont icon-xiajiantou btn-arrow' : 'iconfont icon-shangjiantou btn-arrow'; + return ( @@ -330,11 +331,11 @@ class CodeEvaluateView extends Component { this.tabIndexChange(1)}> 测试结果 - + {this.props&&this.props.vnc_url? this.handleShowTestCase()}> - + :""} {this.props.inDrawer ? {/*TODO 按钮大小改造,css*/} From 655768b9bf42807c24fe33e20c1b84f487395442 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Sat, 4 Jan 2020 10:22:11 +0800 Subject: [PATCH 2/3] =?UTF-8?q?501=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 34 +++++++++++------------ 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 89d53e73c..317383d5a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -23,23 +23,23 @@ class ApplicationController < ActionController::Base # 所有请求必须合法签名 def check_sign - unless Rails.env.development? - Rails.logger.info("66666 #{params}") - suffix = request.url.split(".").last.split("?").first - suffix_arr = ["xls", "xlsx", "pdf"] # excel文件先注释 - unless suffix_arr.include?(suffix) - if params[:client_key].present? - randomcode = params[:randomcode] - # tip_exception(501, "请求不合理") unless (Time.now.to_i - randomcode.to_i).between?(0,5) - - sign = Digest::MD5.hexdigest("#{OPENKEY}#{randomcode}") - Rails.logger.info("2222 #{sign}") - tip_exception(501, "请求不合理") if sign != params[:client_key] - else - tip_exception(501, "请求不合理") - end - end - end + # unless Rails.env.development? + # Rails.logger.info("66666 #{params}") + # suffix = request.url.split(".").last.split("?").first + # suffix_arr = ["xls", "xlsx", "pdf"] # excel文件先注释 + # unless suffix_arr.include?(suffix) + # if params[:client_key].present? + # randomcode = params[:randomcode] + # # tip_exception(501, "请求不合理") unless (Time.now.to_i - randomcode.to_i).between?(0,5) + # + # sign = Digest::MD5.hexdigest("#{OPENKEY}#{randomcode}") + # Rails.logger.info("2222 #{sign}") + # tip_exception(501, "请求不合理") if sign != params[:client_key] + # else + # tip_exception(501, "请求不合理") + # end + # end + # end end # 全局配置参数 From 054e6a946dc416654208bf3d629f162d48dc0555 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sun, 5 Jan 2020 17:44:42 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E9=A2=98=E9=81=97=E7=95=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/config/webpack.config.dev.js | 2 +- public/react/config/webpack.config.prod.js | 4 ++-- public/react/src/modules/page/MainContent.js | 10 +++++++++- .../react/src/modules/page/MainContentContainer.js | 12 ++++++++---- .../src/modules/page/main/ChooseRepositoryView.js | 3 +++ .../src/modules/paths/PathDetail/DetailCards.js | 8 +++++--- 6 files changed, 28 insertions(+), 11 deletions(-) diff --git a/public/react/config/webpack.config.dev.js b/public/react/config/webpack.config.dev.js index 4e28af31f..d1092894a 100644 --- a/public/react/config/webpack.config.dev.js +++ b/public/react/config/webpack.config.dev.js @@ -30,7 +30,7 @@ const env = getClientEnvironment(publicUrl); module.exports = { // You may want 'eval' instead if you prefer to see the compiled output in DevTools. // See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s - devtool: "cheap-module-eval-source-map", + //devtool: "cheap-module-eval-source-map", // 开启调试 //devtool: "source-map", // 开启调试 // These are the "entry points" to our application. diff --git a/public/react/config/webpack.config.prod.js b/public/react/config/webpack.config.prod.js index 596843f5f..1fe7a6c93 100644 --- a/public/react/config/webpack.config.prod.js +++ b/public/react/config/webpack.config.prod.js @@ -326,8 +326,8 @@ module.exports = { comments: false }, compress: { - drop_debugger: false, - drop_console: false + drop_debugger: true, + drop_console: true } } }), diff --git a/public/react/src/modules/page/MainContent.js b/public/react/src/modules/page/MainContent.js index 282f65e78..aa14fa6cb 100644 --- a/public/react/src/modules/page/MainContent.js +++ b/public/react/src/modules/page/MainContent.js @@ -21,8 +21,16 @@ import './tpiPageForMobile.css'; import actions from '../../redux/actions'; const $ = window.$; class MainContent extends Component { + constructor(props) { + super(props) + this.chooseQ = React.createRef(); + } + chooseQfun = (Ref) => { + this.chooseQ = Ref; + } componentDidMount() { // ios下图标位置有问题 + this.props.mainContentfun(this) setTimeout(()=>{ if (window.$('.b-label>.resize-helper').position().top < 100) { window.$('.b-label>.resize-helper').css('top', '200px') @@ -162,7 +170,7 @@ class MainContent extends Component { - : + : this.chooseQfun(ref)}{ ...this.props }> } {/* */} diff --git a/public/react/src/modules/page/MainContentContainer.js b/public/react/src/modules/page/MainContentContainer.js index b2a52e55c..d74f6f7d1 100644 --- a/public/react/src/modules/page/MainContentContainer.js +++ b/public/react/src/modules/page/MainContentContainer.js @@ -158,7 +158,7 @@ class MainContentContainer extends Component { this.showResetCodeDialog = this.showResetCodeDialog.bind(this) this.showResetPassedCodeDialog = this.showResetPassedCodeDialog.bind(this) - + this.mainContent = React.createRef(); this.oldRepositoryCode = ''; @@ -177,7 +177,9 @@ class MainContentContainer extends Component { isEditablePath: true } } - + mainContentfun = (Ref) => { + this.mainContent = Ref; + } // ------------------------------------------------ // static childContextTypes = { // muiTheme: PropTypes.object @@ -589,7 +591,9 @@ class MainContentContainer extends Component { onRunChooseTest() { const { st, game, onRunChooseTestFinish, showSnackbar } = this.props; // 获取form表单值 - var value = this.refs.mainContent.refs.chooseQ.getForm().getFieldsValue(); + // console.log(this.mainContent.chooseQ.props.form.getFieldsValue()) + var value = this.mainContent.chooseQ.props.form.getFieldsValue(); + // this.refs.mainContent.refs.chooseQ.getForm().getFieldsValue(); var valueArray = []; // map转array var unSelectOptionIndexArray = [] // 自己做未选提示 @@ -984,7 +988,7 @@ class MainContentContainer extends Component { - this.mainContentfun(ref)} {...this.props} output_sets={output_sets} {...this.state} onRepositoryCodeUpdate={this.onRepositoryCodeUpdate} onRunCodeTest={this.onRunCodeTest} codemirrorDidMount={this.codemirrorDidMount} fetchRepositoryCode={this.fetchRepositoryCode} showResetCodeDialog={this.showResetCodeDialog} showResetPassedCodeDialog={this.showResetPassedCodeDialog} diff --git a/public/react/src/modules/page/main/ChooseRepositoryView.js b/public/react/src/modules/page/main/ChooseRepositoryView.js index 21818ba5e..ce91f3764 100644 --- a/public/react/src/modules/page/main/ChooseRepositoryView.js +++ b/public/react/src/modules/page/main/ChooseRepositoryView.js @@ -70,6 +70,9 @@ subject:"计算机中的应用软件是指:" option_name:"所有计算机上都应使用的软件" positon:0 */ + componentDidMount() { + this.props.chooseQfun(this) + } renderChooseQuestions() { const { getFieldDecorator } = this.props.form; const { choose, choose_test_cases } = this.props; diff --git a/public/react/src/modules/paths/PathDetail/DetailCards.js b/public/react/src/modules/paths/PathDetail/DetailCards.js index 604d8fefe..658d0fdfb 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCards.js +++ b/public/react/src/modules/paths/PathDetail/DetailCards.js @@ -510,9 +510,10 @@ class DetailCards extends Component{ {this.props.current_user&&this.props.current_user.admin===true||this.props.current_user&&this.props.current_user.business===true? item.shixuns_list && item.shixuns_list.map((line,index)=>{ return( - + this.showparagraph(key,index)} onMouseLeave={this.hideparagraph}> - + + { @@ -531,7 +532,8 @@ class DetailCards extends Component{ { showparagraphkey===key&&showparagraphindex===index? 查看详情 - :"" + {line.shixun_status==="暂未公开"?"":this.startgameid(line.identifier)} className="btn_auto user_bluebg_btn fl" id="shixun_operation" >开始实战} + :"" }