From 8fb9847ff3c5c6b54beb6ba60dcc0bc3816696c8 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 31 Dec 2019 14:38:39 +0800 Subject: [PATCH 01/13] =?UTF-8?q?=E6=8E=92=E5=BA=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/discusses_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/discusses_controller.rb b/app/controllers/discusses_controller.rb index 6b21526dd..e7d692de5 100644 --- a/app/controllers/discusses_controller.rb +++ b/app/controllers/discusses_controller.rb @@ -14,14 +14,14 @@ class DiscussesController < ApplicationController @disscuss_count = Discuss.where(:dis_id => @container.id, :dis_type => @container.class.to_s, :root_id => nil).count disscusses = Discuss.where(:dis_id => @container.id, :dis_type => @container.class.to_s, :root_id => nil) - @discusses = disscusses.limit(LIMIT).joins("left join games on discusses.challenge_id = games.challenge_id and discusses.user_id = games.user_id") - .select("discusses.*, games.identifier").includes(:user, :praise_treads).offset(offset) + @discusses = disscusses.joins("left join games on discusses.challenge_id = games.challenge_id and discusses.user_id = games.user_id") + .select("discusses.*, games.identifier").includes(:user, :praise_treads) else disscusses = Discuss.where("dis_id = :dis_id and dis_type = :dis_type and root_id is null and (discusses.hidden = :hidden or discusses.user_id = :user_id)", {dis_id: @container.id, dis_type: @container.class.to_s, hidden: false, user_id: current_user.id}) @disscuss_count = disscusses.count("discusses.id") - @discusses = disscusses.limit(LIMIT).includes(:user, :praise_treads).offset(offset) + @discusses = disscusses.includes(:user, :praise_treads).limit(LIMIT).offset(offset) end @current_user = current_user From 14f920ab0ec163ddfb54c7cad4d7eceaff6cd5fd Mon Sep 17 00:00:00 2001 From: tangjiang <465264938@qq.com> Date: Tue, 31 Dec 2019 17:53:13 +0800 Subject: [PATCH 02/13] update test-code style --- public/react/src/modules/page/MainContent.js | 7 +++- public/react/src/modules/page/VNC.css | 41 +++++++++++++++++++ public/react/src/modules/page/VNCContainer.js | 15 ++++++- public/react/src/modules/page/VNCDisplay.js | 4 +- 4 files changed, 62 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/page/MainContent.js b/public/react/src/modules/page/MainContent.js index a1b7566d0..175ea7bc0 100644 --- a/public/react/src/modules/page/MainContent.js +++ b/public/react/src/modules/page/MainContent.js @@ -41,6 +41,7 @@ class MainContent extends Component { hideCodeEvaluate = () => { const vncContainer = this.refs['vncContainer'] if (vncContainer) { + // console.log('点击的关闭按钮') vncContainer.onBottomDrawerClose && vncContainer.onBottomDrawerClose() } } @@ -124,7 +125,7 @@ class MainContent extends Component { </div> } ></VNCContainer> - <div id="actionView" className="-layout-h -center -bg-grey-90 -grey-20 -bg-darkblack" style={{height:'48px'}}> + <div id="actionView" className="-layout-h -center -bg-grey-90 -grey-20 -bg-darkblack"> <ActionView {...this.props} onRunCodeTest={onRunCodeTest} ></ActionView> @@ -179,7 +180,9 @@ class MainContent extends Component { </div> </div> - <div id="actionView" className="-layout-h -center -bg-grey-90 -grey-20 -bg-darkblack" style={{height:'48px'}}> + <div id="actionView" + style={{ position: 'absolute', width: '100%', bottom: '0', height: '51px'}} + className="-layout-h -center -bg-grey-90 -grey-20 -bg-darkblack"> <ActionView {...this.props} onRunCodeTest={onRunCodeTest}></ActionView> </div> diff --git a/public/react/src/modules/page/VNC.css b/public/react/src/modules/page/VNC.css index 1180baf76..58a45d735 100644 --- a/public/react/src/modules/page/VNC.css +++ b/public/react/src/modules/page/VNC.css @@ -39,6 +39,47 @@ user-select: none; } +.btn_test_case, +.btn_test_case_active{ + display: inline-block; + position: absolute; + width: 56px; + height: 28px; + bottom: 23px; + line-height: 28px; + background: rgba(42,58,79,1); + z-index: 10; + left: 50%; + margin-left: -28px; + border-bottom-left-radius: 100px; + border-bottom-right-radius: 100px; + color: #fff; + text-align: center; + cursor: pointer; + opacity: .4; + transition: all .3s; +} + +.btn_test_case:hover, +.btn_test_case_active:hover{ + opacity: 1; +} +.btn_test_case .btn-arrow{ + position: relative; + font-size: 12px; + line-height: 28px; + bottom: 2px; +} + +.btn_test_case_active{ + bottom: 203px; + z-index: 10000; + +} +.btn_test_case_active .btn-arrow{ + bottom: 4px; +} + @keyframes mymove { from {right:0px;} diff --git a/public/react/src/modules/page/VNCContainer.js b/public/react/src/modules/page/VNCContainer.js index aa4d82e78..30e439e8d 100644 --- a/public/react/src/modules/page/VNCContainer.js +++ b/public/react/src/modules/page/VNCContainer.js @@ -204,6 +204,10 @@ class VNCContainer extends Component { render() { const { challenge, vnc_url, git_url } = this.props + const _classCtx = this.state.bottomDrawer ? 'btn_test_case_active' : 'btn_test_case'; + const _classes = this.state.bottomDrawer + ? `iconfont icon-xiajiantou btn-arrow` + : 'iconfont icon-shangjiantou btn-arrow'; const secondDrawerChildren = this.renderSecondDrawerChildren(); return ( <React.Fragment> @@ -352,9 +356,16 @@ class VNCContainer extends Component { > { this.props.codeEvaluate } </Drawer> - <FloatButton onClick={this.swtichBottomDrawer} + {/* <FloatButton onClick={this.swtichBottomDrawer} className="codeEvaluateFloatButton" - >测试集</FloatButton> + >测试集</FloatButton> */} + <div + className={_classCtx} + onClick={this.swtichBottomDrawer} + > + {/* <span className="iconfont icon-shangjiantou btn-arrow"></span> */} + <span className={_classes}></span> + </div> </VNCDisplay> diff --git a/public/react/src/modules/page/VNCDisplay.js b/public/react/src/modules/page/VNCDisplay.js index 536ba43cb..98c4cb5e7 100644 --- a/public/react/src/modules/page/VNCDisplay.js +++ b/public/react/src/modules/page/VNCDisplay.js @@ -135,11 +135,13 @@ class VNCDisplay extends Component { <div className="vncDisply" style={{height: '100%'}}> <style>{` .vncDisply #top_bar { + position: absolute; background-color: #6e84a3; color: white; font: bold 12px Helvetica; padding: 6px 5px 4px 5px; border-bottom: 1px outset; + width: 100%; } .vncDisply #status { text-align: center; @@ -166,7 +168,7 @@ class VNCDisplay extends Component { <div id="status">Loading</div> <div id="sendCtrlAltDelButton">Send CtrlAltDel</div> </div> - <div id="screen"> + <div id="screen" style={{ height: 'calc(100vh - 105px)' }}> </div> {this.props.children} From 928e5f010d7cef610f8aa173a589c6ca832247c1 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, 31 Dec 2019 18:52:09 +0800 Subject: [PATCH 03/13] =?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/courses/poll/PollDetailTabForth.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/poll/PollDetailTabForth.js b/public/react/src/modules/courses/poll/PollDetailTabForth.js index 44a09adae..2625418ee 100644 --- a/public/react/src/modules/courses/poll/PollDetailTabForth.js +++ b/public/react/src/modules/courses/poll/PollDetailTabForth.js @@ -112,7 +112,7 @@ class PollDetailTabForth extends Component{ // 已有设置数据的查询 getSettingInfo=()=>{ - this.props.getPollInfo(); + // this.props.getPollInfo(); let pollId=this.props.match.params.pollId; let url=`/polls/${pollId}/poll_setting.json`; axios.get(url).then((result)=>{ @@ -197,6 +197,7 @@ class PollDetailTabForth extends Component{ this.props.form.validateFieldsAndScroll((err, values) => { if(!err){ + this.props.getPollInfo(); // 第一次进行问卷设置或者勾选了统一设置 let{unitSetting}=this.state if(unitSetting==true){ From f55e79aa1657abe6e4663e5e8ac00f7f34f3b011 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, 31 Dec 2019 18:54:25 +0800 Subject: [PATCH 04/13] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/poll/PollDetailIndex.js | 19 ++++++++++++++++++- .../courses/poll/PollDetailTabForth.js | 2 +- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/poll/PollDetailIndex.js b/public/react/src/modules/courses/poll/PollDetailIndex.js index 38cc3796e..d064fc284 100644 --- a/public/react/src/modules/courses/poll/PollDetailIndex.js +++ b/public/react/src/modules/courses/poll/PollDetailIndex.js @@ -68,6 +68,23 @@ class PollDetailIndex extends Component{ } } + newgetPollInfo=()=>{ + // console.log(this.props); + let pollId=this.props.match.params.pollId; + let url=`/polls/${pollId}/common_header.json` + axios.get(url).then((result)=>{ + if(result.status==200){ + this.setState({ + pollDetail:result.data, + user_permission:result.data.user_permission, + polls_status:result.data.polls_status, + }) + } + }).catch((error)=>{ + console.log(error); + }) + + } componentDidMount(){ const query =this.props.location.search; @@ -259,7 +276,7 @@ class PollDetailIndex extends Component{ } { //设置 - parseInt(tab[0])==3 && <PollTabForth {...this.props} {...this.state} triggerRef={this.bindRef} user_permission={user_permission} getPollInfo={this.getPollInfo}></PollTabForth> + parseInt(tab[0])==3 && <PollTabForth {...this.props} {...this.state} triggerRef={this.bindRef} user_permission={user_permission} getPollInfo={this.getPollInfo} newgetPollInfo={this.newgetPollInfo}></PollTabForth> } </div> diff --git a/public/react/src/modules/courses/poll/PollDetailTabForth.js b/public/react/src/modules/courses/poll/PollDetailTabForth.js index 2625418ee..099abed0a 100644 --- a/public/react/src/modules/courses/poll/PollDetailTabForth.js +++ b/public/react/src/modules/courses/poll/PollDetailTabForth.js @@ -197,7 +197,7 @@ class PollDetailTabForth extends Component{ this.props.form.validateFieldsAndScroll((err, values) => { if(!err){ - this.props.getPollInfo(); + this.props.newgetPollInfo(); // 第一次进行问卷设置或者勾选了统一设置 let{unitSetting}=this.state if(unitSetting==true){ From 8da60f4fe4ca0f0e810434ec40f491b1a5decdd6 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, 31 Dec 2019 18:55:00 +0800 Subject: [PATCH 05/13] . --- public/react/src/modules/courses/poll/PollDetailTabForth.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/poll/PollDetailTabForth.js b/public/react/src/modules/courses/poll/PollDetailTabForth.js index 099abed0a..f5c49f0fe 100644 --- a/public/react/src/modules/courses/poll/PollDetailTabForth.js +++ b/public/react/src/modules/courses/poll/PollDetailTabForth.js @@ -112,7 +112,7 @@ class PollDetailTabForth extends Component{ // 已有设置数据的查询 getSettingInfo=()=>{ - // this.props.getPollInfo(); + this.props.newgetPollInfo(); let pollId=this.props.match.params.pollId; let url=`/polls/${pollId}/poll_setting.json`; axios.get(url).then((result)=>{ @@ -197,7 +197,7 @@ class PollDetailTabForth extends Component{ this.props.form.validateFieldsAndScroll((err, values) => { if(!err){ - this.props.newgetPollInfo(); + // 第一次进行问卷设置或者勾选了统一设置 let{unitSetting}=this.state if(unitSetting==true){ From d7e3d8e1d8b9b292bd4ece3752791b9a1d98c82a Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 31 Dec 2019 19:04:16 +0800 Subject: [PATCH 06/13] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_commons_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index e26e67a93..a4d34a1c8 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -1377,12 +1377,12 @@ class HomeworkCommonsController < ApplicationController tip_exception(-1, "作业还未发布,不能评阅") if @homework_detail_manual.comment_status == 0 tip_exception("请至少输入一个评阅") if params[:comment].blank? && params[:hidden_comment].blank? ActiveRecord::Base.transaction do - work_ids = @homework.student_works.where(user_id: @course.teacher_group_user_ids(current_user.id)).pluck(:id) + work_ids = @homework.student_works.where(work_status: [1, 2], user_id: @course.teacher_group_user_ids(current_user.id)).pluck(:id) has_comment_ids = ShixunWorkComment.where(challenge_id: 0, student_work_id: work_ids, batch_comment: 0).pluck(:student_work_id) batch_comment_works = ShixunWorkComment.where(challenge_id: 0, student_work_id: work_ids, batch_comment: 1) batch_comment_works.update_all(comment: params[:comment], hidden_comment: params[:hidden_comment]) work_ids = work_ids - has_comment_ids - batch_comment_works.pluck(:student_work_id) - @homework.student_works.where(work_status: 0, id: work_ids).update_all(work_status: 1, commit_time: @homework.end_time, update_time: Time.now, work_score: 0, final_score: 0) + # @homework.student_works.where(work_status: 0, id: work_ids).update_all(work_status: 1, commit_time: @homework.end_time, update_time: Time.now, work_score: 0, final_score: 0) HomeworkBatchCommentJob.perform_later(params[:comment], params[:hidden_comment], work_ids, @homework.id, current_user.id) normal_status("评阅成功") end From 979c05fd3b00de7940849647c4122e59974f1a3f Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 31 Dec 2019 19:16:43 +0800 Subject: [PATCH 07/13] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/polls_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/polls_controller.rb b/app/controllers/polls_controller.rb index 08d0da42f..bfa96bccf 100644 --- a/app/controllers/polls_controller.rb +++ b/app/controllers/polls_controller.rb @@ -792,12 +792,12 @@ class PollsController < ApplicationController if the_group_setting_status == 2 poll_group_params = { :publish_time => the_group_setting.publish_time, - :end_time => poll_end_time + :end_time => poll_end_time < Time.now ? the_group_setting.end_time : poll_end_time } elsif the_group_setting_status == 3 poll_group_params = { :publish_time => the_group_setting.publish_time, - :end_time => the_group_setting.end_time + :end_time => exercise_end_time } end the_group_setting.update_attributes(poll_group_params) From c87e235e57fc3cef862859f71a1a18e39c00d7bb Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 31 Dec 2019 19:17:05 +0800 Subject: [PATCH 08/13] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/polls_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/polls_controller.rb b/app/controllers/polls_controller.rb index bfa96bccf..3e6914dee 100644 --- a/app/controllers/polls_controller.rb +++ b/app/controllers/polls_controller.rb @@ -797,7 +797,7 @@ class PollsController < ApplicationController elsif the_group_setting_status == 3 poll_group_params = { :publish_time => the_group_setting.publish_time, - :end_time => exercise_end_time + :end_time => poll_end_time } end the_group_setting.update_attributes(poll_group_params) From b5984112a0de81471c70c12d1c01f61072b73333 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 1 Jan 2020 17:22:45 +0800 Subject: [PATCH 09/13] =?UTF-8?q?pdf=E5=AF=BC=E5=87=BA=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 64d03cbac..40c63caa6 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -25,7 +25,7 @@ class ApplicationController < ActionController::Base def check_sign Rails.logger.info("66666 #{params}") suffix = request.url.split(".").last - suffix_arr = ["xls", "xlsx"] # excel文件先注释 + suffix_arr = ["xls", "xlsx", "pdf"] # excel文件先注释 unless suffix_arr.include?(suffix) if params[:client_key].present? randomcode = params[:randomcode] From e6e0385e4c2f2ebe4bd6b94db874292148fa1988 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 1 Jan 2020 17:28:45 +0800 Subject: [PATCH 10/13] =?UTF-8?q?pdf=E5=AF=BC=E5=87=BA=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 40c63caa6..254d04cfd 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -24,7 +24,7 @@ class ApplicationController < ActionController::Base # 所有请求必须合法签名 def check_sign Rails.logger.info("66666 #{params}") - suffix = request.url.split(".").last + suffix = request.url.split(".").last.split("?").first suffix_arr = ["xls", "xlsx", "pdf"] # excel文件先注释 unless suffix_arr.include?(suffix) if params[:client_key].present? From eb0faebdefab3e9cb7eea759729d1a3f28c4efff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 1 Jan 2020 21:54:49 +0800 Subject: [PATCH 11/13] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/common/UrlTool.js | 8 +++++++- .../react/src/modules/courses/exercise/Exercisesetting.js | 1 + .../modules/courses/exercise/Testpapersettinghomepage.js | 4 ++-- .../react/src/modules/courses/graduation/topics/index.js | 4 ++-- .../modules/courses/shixunHomework/ShixunStudentWork.js | 4 ++-- .../modules/courses/shixunHomework/ShixunWorkReport.js | 4 ++-- .../modules/courses/shixunHomework/Trainingjobsetting.js | 4 ++-- .../courses/shixunHomework/Workquestionandanswer.js | 4 ++-- .../src/modules/ecs/EcSetting/CourseSupports/index.js | 4 ++-- public/react/src/modules/modals/DownloadMessage.js | 4 ++-- 10 files changed, 24 insertions(+), 17 deletions(-) diff --git a/public/react/src/common/UrlTool.js b/public/react/src/common/UrlTool.js index 8c3317cf6..d50aef505 100644 --- a/public/react/src/common/UrlTool.js +++ b/public/react/src/common/UrlTool.js @@ -128,7 +128,13 @@ export function getTaskUrlById(id) { export function getRandomcode(url) { Railsgettimes() let anewopens=md5(newopens+newtimestamp); - return `${url}?randomcode=${newtimestamp}&client_key=${anewopens}` + + if (url.indexOf('?') == -1) { + return `${url}?randomcode=${newtimestamp}&client_key=${anewopens}` + }else { + return `${url}&randomcode=${newtimestamp}&client_key=${anewopens}` + } + } export function htmlEncode(str) { diff --git a/public/react/src/modules/courses/exercise/Exercisesetting.js b/public/react/src/modules/courses/exercise/Exercisesetting.js index bf900eb2f..b58f1c4e5 100644 --- a/public/react/src/modules/courses/exercise/Exercisesetting.js +++ b/public/react/src/modules/courses/exercise/Exercisesetting.js @@ -132,6 +132,7 @@ class Exercisesetting extends Component{ // 已有设置数据的查询 getSettingInfo=()=>{ + this.props.Commonheadofthetestpapers() let Id=this.props.match.params.Id; let url=`/exercises/${Id}/exercise_setting.json`; axios.get(url).then((result)=>{ diff --git a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js index ca4a0758a..47f42405d 100644 --- a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js +++ b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js @@ -61,7 +61,7 @@ class Testpapersettinghomepage extends Component{ } //试卷公用头部 Commonheadofthetestpaper=()=>{ - console.log("Commonheadofthetestpaper 试卷公用头部"); + // console.log("Commonheadofthetestpaper 试卷公用头部"); var exercise_id = this.props.match.params.Id; var url = `/exercises/${exercise_id}/common_header.json`; axios.get(url).then((response) => { @@ -475,7 +475,7 @@ class Testpapersettinghomepage extends Component{ } { - parseInt(tab[0])==3 ? <WrappedExercisesetting Commonheadofthetestpaper={this.state.Commonheadofthetestpaper} {...this.props} {...this.state} triggerRef={this.bindRef}></WrappedExercisesetting>:"" + parseInt(tab[0])==3 ? <WrappedExercisesetting Commonheadofthetestpaper={this.state.Commonheadofthetestpaper} {...this.props} {...this.state} triggerRef={this.bindRef} Commonheadofthetestpapers={this.Commonheadofthetestpaper}></WrappedExercisesetting>:"" } </div> </div> diff --git a/public/react/src/modules/courses/graduation/topics/index.js b/public/react/src/modules/courses/graduation/topics/index.js index 5116b0b12..b4bfa6527 100644 --- a/public/react/src/modules/courses/graduation/topics/index.js +++ b/public/react/src/modules/courses/graduation/topics/index.js @@ -5,7 +5,7 @@ import CourseLayoutcomponent from '../../common/CourseLayoutComponent' import Titlesearchsection from '../../common/titleSearch/TitleSearchSection' import DownloadMessageysl from "../../../modals/DownloadMessageysl"; -import { WordsBtn } from 'educoder' +import { WordsBtn ,getRandomcode} from 'educoder' import NoneData from '../../coursesPublic/NoneData' import Modals from "../../../modals/Modals" import axios from 'axios' @@ -353,7 +353,7 @@ onBoardsNew=()=>{ } }else { this.props.showNotification(`正在下载中`); - window.open("/api"+url, '_blank'); + window.open(getRandomcode("/api"+url), '_blank'); } }).catch((error) => { console.log(error) diff --git a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js index 7fe9f868e..772d88e19 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js @@ -1,6 +1,6 @@ import React, {Component} from "react"; import CoursesListType from '../coursesPublic/CoursesListType'; -import {WordsBtn, ActionBtn, sortDirections} from 'educoder'; +import {WordsBtn, getRandomcode, sortDirections} from 'educoder'; import ShixunWorkModal from './Shixunworkdetails/ShixunWorkModal'; import HomeworkModal from "../coursesPublic/HomeworkModal"; import OneSelfOrderModal from "../coursesPublic/OneSelfOrderModal"; @@ -622,7 +622,7 @@ class ShixunStudentWork extends Component { } }else { this.props.showNotification(`正在下载中`); - window.open("/api"+url, '_blank'); + window.open(getRandomcode("/api"+url), '_blank'); } }).catch((error) => { console.log(error) diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index 10b12eb0a..90e6e6a4f 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -1,5 +1,5 @@ import React, {Component} from "react"; -import {WordsBtn,markdownToHTML,ActionBtn,queryString,downloadFile,getImageUrl} from 'educoder'; +import {WordsBtn,markdownToHTML,getRandomcode,queryString,downloadFile,getImageUrl} from 'educoder'; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider,InputNumber, Tag,DatePicker,Radio,Tooltip,Spin} from "antd"; import {Link,Switch,Route,Redirect} from 'react-router-dom'; import axios from 'axios'; @@ -76,7 +76,7 @@ class ShixunWorkReport extends Component { // this.props.slowDownload(url) // // this.props.showNotification(`正在下载中`); - window.open("/api"+url+"?disposition=inline", '_blank'); + window.open(getRandomcode("/api"+url+"?disposition=inline"), '_blank'); this.setState({ isspinning: false }) } }).catch((error) => { diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index 03ae5ec33..d15e8eaab 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -1,7 +1,7 @@ import React, {Component} from "react"; import CoursesListType from '../coursesPublic/CoursesListType'; import HomeworkModal from "../coursesPublic/HomeworkModal"; -import {WordsBtn, ActionBtn, handleDateString, getImageUrl} from 'educoder'; +import {WordsBtn, getRandomcode, handleDateString, getImageUrl} from 'educoder'; import PollDetailTabForthRules from '../poll/PollDetailTabForthRules'; import ShixunWorkModal from './Shixunworkdetails/ShixunWorkModal'; import { @@ -2263,7 +2263,7 @@ class Trainingjobsetting extends Component { } } else { this.props.showNotification(`正在下载中`); - window.open("/api" + url, '_blank'); + window.open(getRandomcode("/api" + url), '_blank'); } }).catch((error) => { console.log(error) diff --git a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js index 1dccb298b..4e3e692e1 100644 --- a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js +++ b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js @@ -1,6 +1,6 @@ import React, {Component} from "react"; import CoursesListType from '../coursesPublic/CoursesListType'; -import {WordsBtn, ActionBtn, markdownToHTML} from 'educoder'; +import {WordsBtn, getRandomcode, markdownToHTML} from 'educoder'; import { Form, Select, @@ -413,7 +413,7 @@ class Workquestionandanswer extends Component { } }else { this.props.showNotification(`正在下载中`); - window.open("/api"+url, '_blank'); + window.open(getRandomcode("/api"+url), '_blank'); } }).catch((error) => { console.log(error) diff --git a/public/react/src/modules/ecs/EcSetting/CourseSupports/index.js b/public/react/src/modules/ecs/EcSetting/CourseSupports/index.js index 6aee871be..4dbc63c95 100644 --- a/public/react/src/modules/ecs/EcSetting/CourseSupports/index.js +++ b/public/react/src/modules/ecs/EcSetting/CourseSupports/index.js @@ -1,7 +1,7 @@ import React, { Component } from 'react'; import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; - +import {getRandomcode} from 'educoder'; import axios from 'axios'; import { Select,message,Modal,Input,Spin,Icon,Tooltip } from 'antd'; @@ -550,7 +550,7 @@ class CourseSupports extends Component { } }else { this.props.showNotification(`正在下载中`); - window.open("/api"+url, '_blank'); + window.open(getRandomcode("/api"+url), '_blank'); } }).catch((error) => { console.log(error) diff --git a/public/react/src/modules/modals/DownloadMessage.js b/public/react/src/modules/modals/DownloadMessage.js index 4655d7478..f01fe14c1 100644 --- a/public/react/src/modules/modals/DownloadMessage.js +++ b/public/react/src/modules/modals/DownloadMessage.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import {getImageUrl} from 'educoder'; +import {getRandomcode} from 'educoder'; import { Modal} from 'antd'; import axios from 'axios'; @@ -57,7 +57,7 @@ class DownloadMessage extends Component { } }else { this.props.showNotification(`正在下载中`); - window.open("/api"+url, '_blank'); + window.open(getRandomcode("/api"+url), '_blank'); } }).catch((error) => { console.log(error) From 9b7a99b018b89820aa60107929afca2dc61286f3 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 2 Jan 2020 09:33:31 +0800 Subject: [PATCH 12/13] =?UTF-8?q?git=E6=9D=83=E9=99=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/gits_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/gits_controller.rb b/app/controllers/gits_controller.rb index bbb0e293e..7484e84b6 100644 --- a/app/controllers/gits_controller.rb +++ b/app/controllers/gits_controller.rb @@ -39,7 +39,7 @@ class GitsController < ApplicationController # 用户是否对对象拥有权限 system_user = User.find_by_login(input_username) || User.find_by_mail(input_username) || User.find_by_phone(input_username) # 如果用户名密码错误 - if system_user && !system_user.check_password?(input_password) + if system_user.blank? || system_user && !system_user.check_password?(input_password) uid_logger_error("git start: password is wrong") result = false else From 831fb7a31289a3496d161f17c853155f1a097385 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 2 Jan 2020 09:35:59 +0800 Subject: [PATCH 13/13] =?UTF-8?q?git=E7=A7=98=E9=92=A5=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/gits_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/gits_controller.rb b/app/controllers/gits_controller.rb index bbb0e293e..3f275533e 100644 --- a/app/controllers/gits_controller.rb +++ b/app/controllers/gits_controller.rb @@ -1,5 +1,5 @@ class GitsController < ApplicationController - + skip_before_action :check_sign # 说明: # 以下Git认证只针对新版git,Gitlab的Git认证不走该控制器 # 思路: