From 527be293c375804baf32ce0c27f6ec44e1f257fc Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 29 Jul 2019 16:19:50 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E5=BC=80=E5=90=AF=E5=AE=9E=E8=AE=AD?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/concerns/git_helper.rb | 2 +- app/controllers/shixuns_controller.rb | 2 +- db/migrate/20190729080934_modify_login_for_users.rb | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20190729080934_modify_login_for_users.rb diff --git a/app/controllers/concerns/git_helper.rb b/app/controllers/concerns/git_helper.rb index 65ebd4074..d77e1c3f6 100644 --- a/app/controllers/concerns/git_helper.rb +++ b/app/controllers/concerns/git_helper.rb @@ -48,7 +48,7 @@ module GitHelper def project_fork(container, original_rep_path, username) raise Educoder::TipException.new("fork源路径为空,fork失败!") if original_rep_path.blank? # 将要生成的仓库名字 - new_repo_name = "#{username}/#{container.try(:identifier)}#{ Time.now.strftime("%Y%m%d%H%M%S")}" + new_repo_name = "#{username.try(:strip)}/#{container.try(:identifier)}#{ Time.now.strftime("%Y%m%d%H%M%S")}" uid_logger("start fork container: repo_name is #{new_repo_name}") GitService.fork_repository(repo_path: original_rep_path, fork_repository_path: (new_repo_name + ".git")) container.update_attributes!(:repo_name => new_repo_name) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 1c272e02d..6c3f34a60 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -716,7 +716,7 @@ class ShixunsController < ApplicationController rescue Exception => e if e.message != "ActiveRecord::RecordInvalid" logger.error("##########project_fork error #{e.message}") - @current_task.destroy! + @myshixun.destroy! end raise "实训云平台繁忙(繁忙等级:81)" end diff --git a/db/migrate/20190729080934_modify_login_for_users.rb b/db/migrate/20190729080934_modify_login_for_users.rb new file mode 100644 index 000000000..96fb9f1d1 --- /dev/null +++ b/db/migrate/20190729080934_modify_login_for_users.rb @@ -0,0 +1,8 @@ +class ModifyLoginForUsers < ActiveRecord::Migration[5.2] + def change + users = User.where("created_on > '2019-07-26 19:00:00'") + users.find_each do |use| + use.update_column(:login, use.login.strip) + end + end +end From 6fae1b8f5832e684e29ec6e798293b5ae57a3990 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Mon, 29 Jul 2019 16:29:30 +0800 Subject: [PATCH 2/7] fix elasticsearch title not highlight bug --- app/services/concerns/elasticsearch_able.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/services/concerns/elasticsearch_able.rb b/app/services/concerns/elasticsearch_able.rb index c1640470c..e93f9c537 100644 --- a/app/services/concerns/elasticsearch_able.rb +++ b/app/services/concerns/elasticsearch_able.rb @@ -22,6 +22,7 @@ module ElasticsearchAble fragment_size: EduSetting.get('es_highlight_fragment_size') || 30, tag: '', fields: { + name: { type: 'plain' }, challenge_names: { type: 'plain' }, challenge_tag_names: { type: 'plain' }, description: { type: 'plain' }, From 6934b3e00625020cc9cdc4290ac55c49a3e1c8b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 29 Jul 2019 16:37:16 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/AppConfig.js | 22 +++++++++++----------- public/react/src/modules/tpm/TPMIndex.css | 4 ++++ public/stylesheets/educoder/edu-all.css | 1 + 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 363ff495d..4928b525f 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -20,16 +20,16 @@ function locationurl(list){ // 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) { @@ -41,7 +41,7 @@ export function initAxiosInterceptors(props) { // proxy = "http://testbdweb.trustie.net" // proxy = "http://testbdweb.educoder.net" // proxy = "https://testeduplus2.educoder.net" - proxy="http://47.96.87.25:48080" + proxy="http://47.96.87.25:48080/" // 在这里使用requestMap控制,避免用户通过双击等操作发出重复的请求; diff --git a/public/react/src/modules/tpm/TPMIndex.css b/public/react/src/modules/tpm/TPMIndex.css index 0e2720b01..2f6eccfd6 100644 --- a/public/react/src/modules/tpm/TPMIndex.css +++ b/public/react/src/modules/tpm/TPMIndex.css @@ -204,4 +204,8 @@ body>.-task-title { .mainheighs{ height: 100%; display: block; +} + +.ml18a{ + margin-left:18%; } \ No newline at end of file diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css index 5ab2dc0ad..29fa6f5dc 100644 --- a/public/stylesheets/educoder/edu-all.css +++ b/public/stylesheets/educoder/edu-all.css @@ -11,6 +11,7 @@ float: left; width: 97px;} .head-nav{ + float: left; text-align: center; height: 60px; box-sizing: border-box; From f8c2316569b4a2be642f5a666cbe4de56377ea44 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 29 Jul 2019 16:41:09 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...n_for_users.rb => 20190729080935_modify_login_for_users.rb} | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) rename db/migrate/{20190729080934_modify_login_for_users.rb => 20190729080935_modify_login_for_users.rb} (50%) diff --git a/db/migrate/20190729080934_modify_login_for_users.rb b/db/migrate/20190729080935_modify_login_for_users.rb similarity index 50% rename from db/migrate/20190729080934_modify_login_for_users.rb rename to db/migrate/20190729080935_modify_login_for_users.rb index 96fb9f1d1..a4a7d3f51 100644 --- a/db/migrate/20190729080934_modify_login_for_users.rb +++ b/db/migrate/20190729080935_modify_login_for_users.rb @@ -2,7 +2,8 @@ class ModifyLoginForUsers < ActiveRecord::Migration[5.2] def change users = User.where("created_on > '2019-07-26 19:00:00'") users.find_each do |use| - use.update_column(:login, use.login.strip) + use.update_attributes(:login, use.login.strip, phone: user.phone.try(:strip)) + use.user_extension.update_column(:student_id,use.user_extension.student_id.try(:strip)) end end end From 5ac943821bc5b7a4cb8424e22b9587510d2b232b Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 29 Jul 2019 16:43:54 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migrate/20190729080935_modify_login_for_users.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/migrate/20190729080935_modify_login_for_users.rb b/db/migrate/20190729080935_modify_login_for_users.rb index a4a7d3f51..e8beb49fe 100644 --- a/db/migrate/20190729080935_modify_login_for_users.rb +++ b/db/migrate/20190729080935_modify_login_for_users.rb @@ -2,7 +2,7 @@ class ModifyLoginForUsers < ActiveRecord::Migration[5.2] def change users = User.where("created_on > '2019-07-26 19:00:00'") users.find_each do |use| - use.update_attributes(:login, use.login.strip, phone: user.phone.try(:strip)) + use.update_attributes(:login, use.login.strip, phone: use.phone.try(:strip)) use.user_extension.update_column(:student_id,use.user_extension.student_id.try(:strip)) end end From db84d635b5c2183f2d0ddbc4dd8dc2cf7e14f4b3 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 29 Jul 2019 16:46:13 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migrate/20190729080935_modify_login_for_users.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/migrate/20190729080935_modify_login_for_users.rb b/db/migrate/20190729080935_modify_login_for_users.rb index e8beb49fe..274e163de 100644 --- a/db/migrate/20190729080935_modify_login_for_users.rb +++ b/db/migrate/20190729080935_modify_login_for_users.rb @@ -2,8 +2,8 @@ class ModifyLoginForUsers < ActiveRecord::Migration[5.2] def change users = User.where("created_on > '2019-07-26 19:00:00'") users.find_each do |use| - use.update_attributes(:login, use.login.strip, phone: use.phone.try(:strip)) - use.user_extension.update_column(:student_id,use.user_extension.student_id.try(:strip)) + use.update_attributes(login: use.login.strip, phone: use.phone.try(:strip)) + use.user_extension.update_column(:student_id, use.user_extension.student_id.try(:strip)) end end end From d62aff64528ea821c4c8932cd619a37a3f17f055 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 29 Jul 2019 16:49:19 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/public/css/edu-all.css | 3 +- public/react/src/AppConfig.js | 20 ++-- public/react/src/modules/tpm/NewHeader.js | 104 ++++++++++---------- public/react/src/modules/tpm/TPMIndexHOC.js | 2 +- public/stylesheets/educoder/edu-all.css | 2 +- 5 files changed, 66 insertions(+), 65 deletions(-) diff --git a/public/react/public/css/edu-all.css b/public/react/public/css/edu-all.css index 4eeb5497c..f58d44978 100644 --- a/public/react/public/css/edu-all.css +++ b/public/react/public/css/edu-all.css @@ -11,10 +11,11 @@ float: left; width: 97px;} .head-nav{ + float: left; text-align: center; height: 60px; box-sizing: border-box; - min-width: 1000px; + min-width: 1200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 4928b525f..2ad7df0d5 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -20,16 +20,16 @@ function locationurl(list){ // 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/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 6b435b619..f4a90fd81 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -713,68 +713,68 @@ submittojoinclass=(value)=>{ >工程认证 - -
-
- {/**/} -
- - 实训 - - -
- {/**/} - {/*搜索框*/} - {showSearchOpentype===true?
this.hideshowSearchOpen(e)} onMouseLeave={()=>this.setevaluatinghides()}> - this.onKeywordSearchKeyDowns()} - onSearch={(value) => this.onKeywordSearchKeyDown(value)} - // onPressEnter={this.onKeywordSearchKeyDown} - style={{ width: 300,height:32}} - autoFocus={true} - /> -
:""} - - {/**/} - {/*/!**!/*/} - {/**/} - - {/**/} - {/* TODO 需要服务端接口提供最近搜索 + } + +
+
+ {/**/} +
+ + 实训 + + +
+ {/**/} + {/*搜索框*/} + {showSearchOpentype===true?
this.hideshowSearchOpen(e)} onMouseLeave={()=>this.setevaluatinghides()}> + this.onKeywordSearchKeyDowns()} + onSearch={(value) => this.onKeywordSearchKeyDown(value)} + // onPressEnter={this.onKeywordSearchKeyDown} + style={{ width: 300,height:32}} + autoFocus={true} + /> +
:""} + + {/**/} + {/*/!**!/*/} + {/**/} + + {/**/} + {/* TODO 需要服务端接口提供最近搜索
最近搜索
*/} -
-
- -
+
- {/* <%= link_to '登录', signin_path, :className => "mr5" %> diff --git a/public/react/src/modules/tpm/TPMIndexHOC.js b/public/react/src/modules/tpm/TPMIndexHOC.js index e092c17d4..0cf22376f 100644 --- a/public/react/src/modules/tpm/TPMIndexHOC.js +++ b/public/react/src/modules/tpm/TPMIndexHOC.js @@ -20,7 +20,7 @@ const versionNum = '0001'; // let _url_origin = getUrl() let _url_origin=''; if(window.location.port === "3007"){ - _url_origin="https://newweb.educoder.net"; + _url_origin="http://47.96.87.25:48080/"; } // let _url_origin=`https://www.educoder.net`; diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css index 29fa6f5dc..6c77ee1c5 100644 --- a/public/stylesheets/educoder/edu-all.css +++ b/public/stylesheets/educoder/edu-all.css @@ -15,7 +15,7 @@ text-align: center; height: 60px; box-sizing: border-box; - min-width: 1000px; + min-width: 1200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;