From 25ded9f09d0959b65b841c370024d0c3baae932e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 9 Aug 2019 16:14:33 +0800 Subject: [PATCH 01/14] =?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/shixunHomework/ShixunHomeworkPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js index c827d73cd..ccf6c4547 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js @@ -132,7 +132,7 @@ class ShixunHomeworkPage extends Component {
-
+

From b5b8103479e73186fc4c1c89b912338a3fb982bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 9 Aug 2019 16:14:49 +0800 Subject: [PATCH 02/14] =?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/shixunHomework/ShixunHomeworkPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js index ccf6c4547..101163f29 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js @@ -132,7 +132,7 @@ class ShixunHomeworkPage extends Component {

-
+

From a0b5fd69fb019c0dcc19e6729a85ff46c5b6fcdd 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, 10 Aug 2019 09:31:43 +0800 Subject: [PATCH 03/14] =?UTF-8?q?=20=E8=B0=83=E6=95=B4=E7=81=AB=E7=8B=90?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E5=8A=A0=E8=BD=BD=E5=88=B7=E6=96=B0=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesPublic/PathModal.js | 18 ++++++++------ .../courses/coursesPublic/ShixunModal.js | 24 +++++++++++-------- .../react/src/modules/courses/css/Courses.css | 4 ++-- 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/PathModal.js b/public/react/src/modules/courses/coursesPublic/PathModal.js index 3fbbd4af4..07ce55024 100644 --- a/public/react/src/modules/courses/coursesPublic/PathModal.js +++ b/public/react/src/modules/courses/coursesPublic/PathModal.js @@ -122,16 +122,20 @@ class PathModal extends Component{ contentViewScrolledit=(e)=>{ //滑动到底判断 + const {shixunmodallist} = this.state; if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ - let {Searchvalue,type,page,shixunpathlist}=this.state; - let newpage=page+1 - this.funshixunpathlist(Searchvalue,type,true,newpage) - this.setState({ - page:newpage - }) - + if(shixunmodallist.subject_list.length===0){ + return; + }else{ + let {Searchvalue,type,page,shixunpathlist}=this.state; + let newpage=page+1 + this.funshixunpathlist(Searchvalue,type,true,newpage) + this.setState({ + page:newpage + }) + } } } diff --git a/public/react/src/modules/courses/coursesPublic/ShixunModal.js b/public/react/src/modules/courses/coursesPublic/ShixunModal.js index 1ae63da90..2a53cf104 100644 --- a/public/react/src/modules/courses/coursesPublic/ShixunModal.js +++ b/public/react/src/modules/courses/coursesPublic/ShixunModal.js @@ -100,17 +100,21 @@ class ShixunModal extends Component{ } contentViewScrolledit=(e)=>{ - + const {shixunmodallist}=this.state; //滑动到底判断 - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ - let {Searchvalue,type,page}=this.state; - let newpage=page+1 - this.setupdatalist(Searchvalue,type,true,newpage) - this.setState({ - page:newpage - }) - } - + if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight) { + + if (shixunmodallist.shixun_list.length === 0) { + return; + } else { + let {Searchvalue, type, page} = this.state; + let newpage = page + 1 + this.setupdatalist(Searchvalue, type, true, newpage) + this.setState({ + page: newpage + }) + } + } } //搜索 diff --git a/public/react/src/modules/courses/css/Courses.css b/public/react/src/modules/courses/css/Courses.css index 47db2f595..b6388b1e7 100644 --- a/public/react/src/modules/courses/css/Courses.css +++ b/public/react/src/modules/courses/css/Courses.css @@ -477,9 +477,9 @@ a.white-btn.use_scope-btn:hover{ } .pathInfobox li{ margin-right: 20px; - height: 15px; + height: 20px; /*overflow: hidden;*/ - line-height: 15px; + line-height: 20px; } .width70f{ width: 70px; From 5a180802c6f16323fae28f2552223b079a334f9d 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, 10 Aug 2019 09:52:52 +0800 Subject: [PATCH 04/14] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=9F=A5=E9=87=8D=E8=B7=B3=E8=BD=AC=E5=92=8C=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/shixunHomework/ShixunStudentWork.js | 4 +++- .../shixunHomework/Shixunworkdetails/ShixunWorkModal.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js index 97bc651ea..511c40d61 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js @@ -783,7 +783,9 @@ class ShixunStudentWork extends Component { + style={{paddingTop: '4px',float: 'left', + maxWidth: '1020px'}} + > {data&&data.group_info === undefined ? "" : data&&data.group_info.map((item, key) => { return ( diff --git a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js index 75a7c5ca1..977b459d4 100644 --- a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js +++ b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js @@ -195,7 +195,7 @@ class ShixunWorkModal extends Component{ // message:"提示", // description: response.data.message // }); - this.props.history.replace(`/courses/${this.props.match.params.coursesId}/shixun_homeworks/${this.props.match.params.homeworkid}/student_work?tab=2`); + window.location.href=`/courses/${this.props.match.params.coursesId}/shixun_homeworks/${this.props.match.params.homeworkid}/student_work?tab=2`; }else if(response.data.status === -1){ notification.open({ message:"提示", From f0f091f4760df78e9881bb61bc69052898191b3d Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 10 Aug 2019 10:01:49 +0800 Subject: [PATCH 05/14] =?UTF-8?q?=E5=90=84=E5=A4=A7=E4=B8=BB=E4=B8=9A?= =?UTF-8?q?=E4=B8=8D=E9=9C=80=E8=A6=81=E7=99=BB=E5=BD=95=E5=B0=B1=E8=83=BD?= =?UTF-8?q?=E8=AE=BF=E9=97=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/challenges_controller.rb | 2 +- app/controllers/shixuns_controller.rb | 2 +- app/controllers/stages_controller.rb | 2 +- app/controllers/subjects_controller.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/challenges_controller.rb b/app/controllers/challenges_controller.rb index 74352724c..ebce98b62 100644 --- a/app/controllers/challenges_controller.rb +++ b/app/controllers/challenges_controller.rb @@ -1,5 +1,5 @@ class ChallengesController < ApplicationController - before_action :require_login, :check_auth + before_action :require_login, :check_auth, except: [:index] before_action :find_shixun, only: [:new, :create, :index] skip_before_action :verify_authenticity_token, only: [:create, :update, :create_choose_question, :crud_answer] before_action :find_challenge, only: [:edit, :show, :update, :create_choose_question, :index_down, :index_up, diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 3145636df..58dc355cc 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -2,7 +2,7 @@ class ShixunsController < ApplicationController include ShixunsHelper include ApplicationHelper - before_action :require_login, :check_auth, except: [:download_file, :index, :menus] + before_action :require_login, :check_auth, except: [:download_file, :index, :menus, :show, :show_right] before_action :check_account, only: [:new, :create, :shixun_exec] diff --git a/app/controllers/stages_controller.rb b/app/controllers/stages_controller.rb index 3967554aa..acf0e4829 100644 --- a/app/controllers/stages_controller.rb +++ b/app/controllers/stages_controller.rb @@ -1,5 +1,5 @@ class StagesController < ApplicationController - before_action :require_login, :check_auth + before_action :require_login, :check_auth, except: [:index] before_action :find_subject, only: [:create, :index] before_action :find_stage, only: [:update, :destroy, :edit, :up_position, :down_position] before_action :allowed, except: [:index] diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index 396c0900e..c35397684 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -1,5 +1,5 @@ class SubjectsController < ApplicationController - before_action :require_login, :check_auth, except: [:index] + before_action :require_login, :check_auth, except: [:index, :show] # before_action :check_auth, except: [:index] before_action :check_account, only: [:new, :create] before_action :find_subject, except: [:index, :create, :new, :append_to_stage] From 74cddf178e91e88d5d07ddbe5567016066cf2dca 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, 10 Aug 2019 10:22:54 +0800 Subject: [PATCH 06/14] =?UTF-8?q?tab=20=E9=A6=96=E9=A1=B5=E7=AD=9B?= =?UTF-8?q?=E9=80=89=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesHome/CoursesHome.js | 30 ++++---- .../src/modules/paths/ShixunPathSearch.js | 30 ++++---- .../src/modules/tpm/shixuns/ShixunCardList.js | 72 +++++++++---------- .../src/modules/tpm/shixuns/ShixunsIndex.js | 2 +- 4 files changed, 67 insertions(+), 67 deletions(-) diff --git a/public/react/src/modules/courses/coursesHome/CoursesHome.js b/public/react/src/modules/courses/coursesHome/CoursesHome.js index 962413e54..374094546 100644 --- a/public/react/src/modules/courses/coursesHome/CoursesHome.js +++ b/public/react/src/modules/courses/coursesHome/CoursesHome.js @@ -16,7 +16,7 @@ class CoursesHome extends Component{ this.state = { limit:16, page:1, - order:"all", + order:"created_at", coursesHomelist:undefined, search:"", } @@ -118,25 +118,25 @@ class CoursesHome extends Component{

diff --git a/public/react/src/modules/paths/ShixunPathSearch.js b/public/react/src/modules/paths/ShixunPathSearch.js index da19e0521..3cba8e33f 100644 --- a/public/react/src/modules/paths/ShixunPathSearch.js +++ b/public/react/src/modules/paths/ShixunPathSearch.js @@ -14,7 +14,7 @@ class ShixunPathSearch extends Component{ constructor(props) { super(props) this.state = { - order:"publish_time", + order:"updated_at", select:0, search:"", page:1, @@ -126,20 +126,20 @@ class ShixunPathSearch extends Component{
{ diff --git a/public/react/src/modules/tpm/shixuns/ShixunCardList.js b/public/react/src/modules/tpm/shixuns/ShixunCardList.js index 078016057..2a557c78d 100644 --- a/public/react/src/modules/tpm/shixuns/ShixunCardList.js +++ b/public/react/src/modules/tpm/shixuns/ShixunCardList.js @@ -166,16 +166,16 @@ class ShixunCardList extends Component {
-
this.latestHot(e,1)}>全部 -
-
this.onSwitchChange(e,2)}>我的 -
+ {/*
this.latestHot(e,1)}>全部*/} + {/*
*/} + {/*
this.onSwitchChange(e,2)}>我的*/} + {/*
*/} -
this.latestHot(e,4)}>最新
@@ -186,26 +186,26 @@ class ShixunCardList extends Component {
-
this.upcircles("asc")} - > - - - {/**/} - -
-
this.upcircles("desc")} - style={{display:upcircle===true?"none":"block"}} - > - - - {/**/} - -
- -
+ {/*
this.upcircles("asc")}*/} + {/*>*/} + {/**/} + {/**/} + {/*/!**!/*/} + {/**/} + {/*
*/} + {/*
this.upcircles("desc")}*/} + {/*style={{display:upcircle===true?"none":"block"}}*/} + {/*>*/} + {/**/} + {/**/} + {/*/!**!/*/} + {/**/} + {/*
*/} + + {/*
*/} {/* this.Input_search(value)} autoComplete="off" > */} -
-
- { - this.props.search_tags === null ? "" : this.props.search_tags - } + {/*
*/} + {/*
*/} + {/*{*/} + {/*this.props.search_tags === null ? "" : this.props.search_tags*/} + {/*}*/} {/*
*/} {/*/!*
*/} {/* *!/*/} @@ -242,8 +242,8 @@ class ShixunCardList extends Component { {/*
*/} {/*隐藏我的*/} -
- + {/*
*/} + {/**/}
); diff --git a/public/react/src/modules/tpm/shixuns/ShixunsIndex.js b/public/react/src/modules/tpm/shixuns/ShixunsIndex.js index 9a73a2f6d..68652c3d2 100644 --- a/public/react/src/modules/tpm/shixuns/ShixunsIndex.js +++ b/public/react/src/modules/tpm/shixuns/ShixunsIndex.js @@ -28,7 +28,7 @@ class ShixunsIndex extends Component { constructor(props) { super(props) this.state={ - order_by: "publish_time", + order_by: "new", page:1, limit:16, keyword:"", From 9ab8ef8b29fae1a93df3e3d9d8300b543737822c Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 10 Aug 2019 10:29:16 +0800 Subject: [PATCH 07/14] =?UTF-8?q?=E5=BC=80=E5=8F=91=E7=A4=BE=E5=8C=BA?= =?UTF-8?q?=E3=80=82=E5=AE=9E=E8=B7=B5=E8=AF=BE=E7=A8=8B=E9=83=BD=E4=B8=8D?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 58dc355cc..fb999b879 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -2,7 +2,8 @@ class ShixunsController < ApplicationController include ShixunsHelper include ApplicationHelper - before_action :require_login, :check_auth, except: [:download_file, :index, :menus, :show, :show_right] + before_action :require_login, :check_auth, except: [:download_file, :index, :menus, :show, :show_right, :ranking_list, + :discusses, :collaborators, :fork_list, :propaedeutics] before_action :check_account, only: [:new, :create, :shixun_exec] From d8ce09cdb4b10637bb47a37d497f7d558e4f0377 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, 10 Aug 2019 10:36:27 +0800 Subject: [PATCH 08/14] =?UTF-8?q?tab=20=E9=A6=96=E9=A1=B5=E7=AD=9B?= =?UTF-8?q?=E9=80=89=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/coursesHome/CoursesHome.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/coursesHome/CoursesHome.js b/public/react/src/modules/courses/coursesHome/CoursesHome.js index 374094546..2cf7aca90 100644 --- a/public/react/src/modules/courses/coursesHome/CoursesHome.js +++ b/public/react/src/modules/courses/coursesHome/CoursesHome.js @@ -124,8 +124,8 @@ class CoursesHome extends Component{ {/*onClick={ () => this.changeStatus("mine")}>我的*/} this.changeStatus("created_at")}>最新 - this.changeStatus("course_members_count")}>最热 + this.changeStatus("visits")}>最热 {/*
*/} {/*/!* Date: Sat, 10 Aug 2019 10:46:42 +0800 Subject: [PATCH 09/14] =?UTF-8?q?=E4=B8=BB=E9=A1=B5=E6=8E=92=E5=BA=8F?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 30 ++++++--------------------- 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 8ea6df506..6aaa04f12 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -49,30 +49,12 @@ class CoursesController < ApplicationController @user = current_user # 根据分类查询课堂(全部,我的,最新,最热) @order = params[:order].present? ? params[:order] : "all" - order_str = @order != "course_members_count" && @order != "created_at" ? "updated_at" : @order - - # if @order == "all" - # @course = Course.where(is_delete: 0, is_hidden: 0).select("select c.name, c.id, s.name, u.login, ifnull(concat(u.lastname,u.firstname), - # u.login), s.name from courses c, users u, user_extensions ue, schools s where c.is_delete=0 and - # c.tea_id=u.id and u.id=ue.user_id and ue.school_id=s.id") - - # @courses = Course.where(is_delete: 0, is_hidden: 0) - # .order("courses.id = 1309 desc, courses.created_at desc") - - # @courses = Course.where(is_delete: 0, is_hidden: 0).select("courses.id, courses.tea_id, courses.name, courses.exercises_count, courses.polls_count, - # courses.is_public, courses.is_end, courses.visits, courses.course_members_count,courses.homework_commons_count,(SELECT MAX(created_at) - # FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a") - # .order("courses.id = 1309 desc, a desc") - if @order == "mine" - tip_exception(401, "..") unless current_user.logged? - @courses = Course.joins(:course_members) - .where("is_delete = 0 AND is_hidden = 0 AND course_members.user_id = ?", @user.id).distinct - elsif @order == "created_at" - # REDO:Extension - @courses = Course.where(is_delete: 0, is_hidden: 0, is_end: 0).distinct + if @order == "visits" + order_str = "courses.id = 1309 DESC, courses.visits DESC" + @courses = Course.where(is_delete: 0, is_hidden: 0) else - # REDO:Extension - @courses = Course.where(is_delete: 0, is_hidden: 0).distinct + order_str = "courses.id = 1309 DESC, courses.homepage_show DESC, courses.created_at desc" + @courses = Course.where(is_delete: 0, is_hidden: 0, is_end: 0) end # 根据搜索关键字进一步筛选 @@ -92,7 +74,7 @@ class CoursesController < ApplicationController .where("#{sql}", keyword: "%#{params[:search]}%").distinct end @courses_count = @courses.count("courses.id") - @courses = @courses.order("courses.id = 1309 DESC, courses.#{order_str} DESC") + @courses = @courses.order(order_str) # 分页 page = params[:page] || 1 From 908e1a201d9215c7285136d98af8740c30b22d7f 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, 10 Aug 2019 11:28:47 +0800 Subject: [PATCH 10/14] =?UTF-8?q?=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/AppConfig.js | 20 +++++++++---------- .../shixunHomework/ShixunWorkReport.js | 7 +++++++ .../modules/paths/PathDetail/DetailCards.js | 8 ++++++++ .../paths/PathDetail/PathDetailIndex.js | 9 +++++++++ public/react/src/modules/tpm/TPMBanner.js | 17 +++++++++++++++- .../tpm/shixunchild/Challenges/Challenges.js | 9 ++++++++- 6 files changed, 58 insertions(+), 12 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index c09a2cbe7..174b163d8 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -20,16 +20,16 @@ let hashTimeout // TODO 开发期多个身份切换 let debugType ="" -if (isDev) { - const _search = window.location.search; - let parsed = {}; - if (_search) { - parsed = queryString.parse(_search); - } - debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : - window.location.search.indexOf('debug=s') != -1 ? 'student' : - window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' -} +// if (isDev) { +// const _search = window.location.search; +// let parsed = {}; +// if (_search) { +// parsed = queryString.parse(_search); +// } +// debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : +// window.location.search.indexOf('debug=s') != -1 ? 'student' : +// window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' +// } window._debugType = debugType; export function initAxiosInterceptors(props) { diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index 565121e1b..6b27a666b 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -75,10 +75,15 @@ class ShixunWorkReport extends Component { let homeworkid=this.props.match.params.homeworkid; let url = `/student_works/${homeworkid}/shixun_work_report.json` axios.get(url).then((result) => { + if (response.data.status === 403||response.data.status === 401||response.data.status === 407||response.data.status === 408) { + + }else{ this.setState({ data:result.data, spinning:false }) + } + }).catch((error) => { console.log(error) this.setState({ @@ -111,6 +116,8 @@ class ShixunWorkReport extends Component { } render() { let{data} =this.state; + console.log(data) + console.log(this.props) let category_id=data===undefined?"":data.category===null?"":data.category.category_id; let homework_common_id=data===undefined?"":data.homework_common_id; let homeworkid=this.props.match.params.homeworkid; diff --git a/public/react/src/modules/paths/PathDetail/DetailCards.js b/public/react/src/modules/paths/PathDetail/DetailCards.js index 21165ff57..1dd93daa8 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCards.js +++ b/public/react/src/modules/paths/PathDetail/DetailCards.js @@ -193,12 +193,20 @@ class DetailCards extends Component{ } startgameid=(id)=>{ + + if(this.props.checkIfLogin()===false){ + this.props.showLoginDialog() + return + } + if(this.props.current_user&&this.props.current_user.profile_completed===false){ this.setState({ AccountProfiletype:true }) return } + + let url = "/shixuns/" + id + "/shixun_exec.json"; axios.get(url).then((response) => { diff --git a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js index 36537e7d0..1d233a775 100644 --- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js +++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js @@ -326,6 +326,15 @@ class PathDetailIndex extends Component{ return(
+ { - let id = this.props.match.params.shixunId; + if(this.props.checkIfLogin()===false){ + this.props.showLoginDialog() + return + } + if(this.props.current_user&&this.props.current_user.profile_completed===false){ + this.setState({ + AccountProfiletype:true + }) + return + } + let id = this.props.match.params.shixunId; let url="/shixuns/" + id +"/search_user_courses.json"; this.setState({ Senttothetype:true @@ -384,6 +394,11 @@ class TPMBanner extends Component { //开始实战按钮 startshixunCombat=(id, reset)=>{ + if(this.props.checkIfLogin()===false){ + this.props.showLoginDialog() + return + } + if(this.props.current_user&&this.props.current_user.profile_completed===false){ this.setState({ AccountProfiletype:true diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js index 980e1d5b2..66054142a 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js @@ -220,6 +220,13 @@ class Challenges extends Component { //开始实战按钮 startshixunCombat = (type, ids, id) => { + + if(this.props.checkIfLogin()===false){ + this.props.showLoginDialog() + return + } + + if(this.props.current_user&&this.props.current_user.profile_completed===false){ this.setState({ AccountProfiletype:true @@ -227,7 +234,7 @@ class Challenges extends Component { return } - debugger + let { ChallengesDataList } = this.state; // let id = this.props.match.params.shixunId; this.setState({ From 51c06f366f19841eb5ce948ec720135ad0308ab4 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, 10 Aug 2019 11:32:33 +0800 Subject: [PATCH 11/14] b --- .../src/modules/courses/shixunHomework/ShixunWorkReport.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index 6b27a666b..490bb1283 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -75,7 +75,7 @@ class ShixunWorkReport extends Component { let homeworkid=this.props.match.params.homeworkid; let url = `/student_works/${homeworkid}/shixun_work_report.json` axios.get(url).then((result) => { - if (response.data.status === 403||response.data.status === 401||response.data.status === 407||response.data.status === 408) { + if (result.data.status === 403||result.data.status === 401||result.data.status === 407||result.data.status === 408) { }else{ this.setState({ From 62316bf168557b8bc04e2fe482ba5306c7b8e084 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 10 Aug 2019 14:23:54 +0800 Subject: [PATCH 12/14] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=AE=9E=E8=B7=B5?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=8F=91=E9=80=81=E8=87=B3=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E8=B5=84=E6=96=99=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/subjects_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index c35397684..825040528 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -1,7 +1,7 @@ class SubjectsController < ApplicationController before_action :require_login, :check_auth, except: [:index, :show] # before_action :check_auth, except: [:index] - before_action :check_account, only: [:new, :create] + before_action :check_account, except: [:index, :show] before_action :find_subject, except: [:index, :create, :new, :append_to_stage] before_action :allowed, only: [:update, :edit, :destroy, :publish, :cancel_publish, :cancel_has_publish, :search_members, :add_subject_members, :statistics, :shixun_report, :school_report, From da5ebae5099ec15a8f0296b400d9217c2bf99d45 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 10 Aug 2019 14:32:48 +0800 Subject: [PATCH 13/14] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E8=AF=84=E8=AE=BA?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E7=99=BB=E5=BD=95=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/discusses_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/discusses_controller.rb b/app/controllers/discusses_controller.rb index 4af27b919..6ddf71ba4 100644 --- a/app/controllers/discusses_controller.rb +++ b/app/controllers/discusses_controller.rb @@ -1,5 +1,6 @@ class DiscussesController < ApplicationController LIMIT = 10 + before_action :require_login, only: [:create, :reply, :hidden, :reward_code, :plus, :destroy] before_action :find_container, only: [:index, :hidden] before_action :find_discuss, except: [:create, :index, :new_message, :reward_code, :forum_discusses, :plus] From 8fcd326566027d464e1a3638120e4bf594a9d6d9 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, 10 Aug 2019 14:35:39 +0800 Subject: [PATCH 14/14] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E9=80=80=E5=87=BA=E5=88=B7=E6=96=B0=E6=B5=8F=E8=A7=88=E5=99=A8?= =?UTF-8?q?=20=E8=B0=B7=E6=AD=8C/=E5=AE=9E=E8=B7=B5=E8=AF=BE=E7=A8=8B?= =?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 | 20 +- .../paths/PathDetail/PathDetailIndex.js | 2 +- .../paths/PathDetail/addCollaborators.js | 427 +++++++++--------- public/react/src/modules/tpm/NewHeader.js | 5 +- 4 files changed, 225 insertions(+), 229 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 174b163d8..c09a2cbe7 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -20,16 +20,16 @@ let hashTimeout // TODO 开发期多个身份切换 let debugType ="" -// if (isDev) { -// const _search = window.location.search; -// let parsed = {}; -// if (_search) { -// parsed = queryString.parse(_search); -// } -// debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : -// window.location.search.indexOf('debug=s') != -1 ? 'student' : -// window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' -// } +if (isDev) { + const _search = window.location.search; + let parsed = {}; + if (_search) { + parsed = queryString.parse(_search); + } + debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : + window.location.search.indexOf('debug=s') != -1 ? 'student' : + window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' +} window._debugType = debugType; export function initAxiosInterceptors(props) { diff --git a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js index 1d233a775..302af3d52 100644 --- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js +++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js @@ -426,7 +426,7 @@ class PathDetailIndex extends Component{
} { - detailInfoList === undefined ? "" : detailInfoList.progress === null ? "" : + this.props.checkIfLogin()===false?"":detailInfoList === undefined ? "" : detailInfoList.progress === null ? "" :

我的进展 diff --git a/public/react/src/modules/paths/PathDetail/addCollaborators.js b/public/react/src/modules/paths/PathDetail/addCollaborators.js index c828f1589..6100ab2f6 100644 --- a/public/react/src/modules/paths/PathDetail/addCollaborators.js +++ b/public/react/src/modules/paths/PathDetail/addCollaborators.js @@ -1,216 +1,213 @@ -import React, { Component } from 'react'; -import { Modal,Checkbox,Input } from "antd"; -import axios from 'axios'; - -const Search = Input.Search; -const CheckboxGroup = Checkbox.Group; -class addCollaborators extends Component{ - constructor(props){ - super(props); - this.state = { - addPartner:false, - page:1, - partnerList:undefined, - search:'', - partnerListid:[], - checkAll: false, - optionss:[] - } - } - addBox=()=>{ - - this.setState({ - addPartner:true, - search:"", - page:1, - partnerList:undefined, - optionss:[] - }) - this.searchList("") - - } - hideAddBox=()=>{ - this.setState({ - addPartner:false, - optionss:[], - partnerListid:[] - }) - } - // 搜索框输入 - changeSearchValue=(e)=>{ - this.setState({ - search: e.target.value - }) - } - // 回车搜索--搜索成功后page为1 - searchList=()=>{ - let id=this.props.match.params.pathId; - let {search,page}=this.state; - let url='/paths/'+id+'/search_members.json?search='+search+"&page="+page; - axios.post(url).then((result)=>{ - if(result.status==200){ - let list=result.data.users; - let optionss=[] - for(var i=0; i{ - console.log(error); - }) - } - - - SaveAddBox=()=>{ - let {partnerListid} =this.state; - let id=this.props.match.params.pathId; - let url="/paths/"+id+"/add_subject_members.json" - axios.post(url,{ - user_ids:partnerListid - }).then((response) => { - if(response.status==200){ - this.setState({ - addPartner:false, - optionss:[], - partnerListid:[] - }) - this.props.updatadetailInfoLists(); - } - }).catch((error) => { - console.log(error) - }); - } - - addCollaboratorsid=(id)=>{ - this.setState({ - partnerListid:id - }) - } - - onCheckAllChange = (e) => { - let {optionss} =this.state; - - if(e.target.checked===true){ - this.setState({ - checkAll: e.target.checked, - partnerListid:optionss - }); - }else{ - this.setState({ - checkAll: e.target.checked, - partnerListid:[] - }); - } - - } - - contentViewScroll=(e)=>{ - //滑动到底判断 - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ - // console.log("到达底部"); - - let id=this.props.match.params.pathId; - let {search,page,partnerList,optionss}=this.state; - let newpage=page+1; - let url='/paths/'+id+'/search_members.json?search='+search+"&page="+newpage; - - axios.post(url).then((result)=>{ - if(result.status==200){ - let list=result.data.users; - let newlist=partnerList; - for(var j=0; j{ - console.log(error); - }) - - } - - } - - render(){ - let {addPartner,search,partnerList,optionss,checkAll,partnerListid} = this.state; - - return( -

- { - this.props.detailInfoList===undefined?"":this.props.detailInfoList.allow_add_member===true? - + 添加合作者 - :"" - } - - -
-
- this.searchList(search)} /> -
-

- - 姓名 - 昵称 - 职位 - 单位 -

-
    - - { - partnerList && partnerList.map((item,key)=>{ - return( -
  • - - {item.user_name} - {item.nickname} - {item.identity} - {item.school_name} -
  • - ) - }) - } -
    -
-
- 取消 - 确定 -
-
-
-
- ) - } -} +import React, { Component } from 'react'; +import { Modal,Checkbox,Input } from "antd"; +import axios from 'axios'; + +const Search = Input.Search; +const CheckboxGroup = Checkbox.Group; +class addCollaborators extends Component{ + constructor(props){ + super(props); + this.state = { + addPartner:false, + page:1, + partnerList:undefined, + search:'', + partnerListid:[], + checkAll: false, + optionss:[] + } + } + addBox=()=>{ + + this.setState({ + addPartner:true, + search:"", + page:1, + partnerList:undefined, + optionss:[] + }) + this.searchList("") + + } + hideAddBox=()=>{ + this.setState({ + addPartner:false, + optionss:[], + partnerListid:[] + }) + } + // 搜索框输入 + changeSearchValue=(e)=>{ + this.setState({ + search: e.target.value + }) + } + // 回车搜索--搜索成功后page为1 + searchList=()=>{ + let id=this.props.match.params.pathId; + let {search,page}=this.state; + let url='/paths/'+id+'/search_members.json?search='+search+"&page="+page; + axios.post(url).then((result)=>{ + if(result.status==200){ + let list=result.data.users; + let optionss=[] + for(var i=0; i{ + console.log(error); + }) + } + + + SaveAddBox=()=>{ + let {partnerListid} =this.state; + let id=this.props.match.params.pathId; + let url="/paths/"+id+"/add_subject_members.json" + axios.post(url,{ + user_ids:partnerListid + }).then((response) => { + if(response.status==200){ + this.setState({ + addPartner:false, + optionss:[], + partnerListid:[] + }) + this.props.updatadetailInfoLists(); + } + }).catch((error) => { + console.log(error) + }); + } + + addCollaboratorsid=(id)=>{ + this.setState({ + partnerListid:id + }) + } + + onCheckAllChange = (e) => { + let {optionss} =this.state; + + if(e.target.checked===true){ + this.setState({ + checkAll: e.target.checked, + partnerListid:optionss + }); + }else{ + this.setState({ + checkAll: e.target.checked, + partnerListid:[] + }); + } + + } + + contentViewScroll=(e)=>{ + //滑动到底判断 + if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ + // console.log("到达底部"); + + let id=this.props.match.params.pathId; + let {search,page,partnerList,optionss}=this.state; + let newpage=page+1; + let url='/paths/'+id+'/search_members.json?search='+search+"&page="+newpage; + + axios.post(url).then((result)=>{ + if(result.status==200){ + let list=result.data.users; + let newlist=partnerList; + for(var j=0; j{ + console.log(error); + }) + + } + + } + + render(){ + let {addPartner,search,partnerList,optionss,checkAll,partnerListid} = this.state; + + return( + this.props.detailInfoList===undefined?"":this.props.detailInfoList.allow_add_member===true? +
+ + 添加合作者 + +
+
+ this.searchList(search)} /> +
+

+ + 姓名 + 昵称 + 职位 + 单位 +

+
    + + { + partnerList && partnerList.map((item,key)=>{ + return( +
  • + + {item.user_name} + {item.nickname} + {item.identity} + {item.school_name} +
  • + ) + }) + } +
    +
+
+ 取消 + 确定 +
+
+
+
:"" + + ) + } +} export default addCollaborators; \ No newline at end of file diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 7e40b9edd..799109b9f 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -8,7 +8,7 @@ import PropTypes from 'prop-types'; // /images/educoder/icon/search.svg -import { getImageUrl, toPath } from 'educoder' +import { getImageUrl, toPath ,trigger,broadcastChannelPostMessage} from 'educoder' import axios from 'axios'; @@ -30,8 +30,6 @@ import 'antd/lib/input/style/index.css'; import './TPMIndex.css'; -import { trigger, broadcastChannelPostMessage } from 'educoder'; - const $ = window.$ // TODO 这部分脚本从公共脚本中直接调用 @@ -316,6 +314,7 @@ class NewHeader extends Component { // this.setState({ // isRender:true // }) + broadcastChannelPostMessage('refreshPage') window.location.href = "/"; } }).catch((error) => {