From db1511a6767b509575b24a02e9cd44a825f76fed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 29 Jul 2019 16:16:17 +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 --- .../modules/user/LoginRegisterComponent.js | 111 +++++++++--------- 1 file changed, 57 insertions(+), 54 deletions(-) diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index ff03b11ea..5b5250004 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -678,60 +678,63 @@ class LoginRegisterComponent extends Component { } //失去焦点判断 inputOnBlur = (e, id) => { - // this.isCorrectname(e.target.value, id); - // this.Emailphonenumberverification(e.target.value, id); - if (e.target.value.length === 0) { - this.setState({ - Phonenumberisnotco: undefined, - Phonenumberisnotcobool: false, - }) - return; - } - // var telephone = $("#telephoneAdd.tianjia_phone").val(); - var regph = /^[1][3,4,5,6,7,8][0-9]{9}$/; - // var email = $("#add_email.tianjia_email").val(); - var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; - - // [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。 - var stringdata = undefined; - if (!regph.test(e.target.value)) { - stringdata = "手机号格式不正确"; - this.setState({ - Phonenumberisnotco: stringdata, - Phonenumberisnotcobool: true, - dragOk:false, - Whethertoverify:this.state.Whethertoverify===true?false:true, - }) - } else { - this.setState({ - Phonenumberisnotco: undefined, - Phonenumberisnotcobool: false, - }) - return - } - - if (!regemail.test(e.target.value)) { - if ((e.target.value.indexOf("@") != -1) === true) { - stringdata = "邮箱格式不正确"; - } else { - stringdata = "手机号格式不正确"; - - } - this.setState({ - Phonenumberisnotco: stringdata, - Phonenumberisnotcobool: true, - dragOk:false, - Whethertoverify:this.state.Whethertoverify===true?false:true, - }) - return - } else { - this.setState({ - Phonenumberisnotco: undefined, - Phonenumberisnotcobool: false, - }) - this.Emailphonenumberverification(e.target.value, 1); - return - } + // debugger + // // this.isCorrectname(e.target.value, id); + // // this.Emailphonenumberverification(e.target.value, id); + // if (e.target.value.length === 0) { + // this.setState({ + // Phonenumberisnotco: undefined, + // Phonenumberisnotcobool: false, + // }) + // return; + // } + // // var telephone = $("#telephoneAdd.tianjia_phone").val(); + // var regph = /^[1][3,4,5,6,7,8][0-9]{9}$/; + // // var email = $("#add_email.tianjia_email").val(); + // var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; + // + // // [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。 + // var stringdata = undefined; + // if (!regph.test(e.target.value)) { + // stringdata = "手机号格式不正确"; + // this.setState({ + // Phonenumberisnotco: stringdata, + // Phonenumberisnotcobool: true, + // dragOk:false, + // Whethertoverify:this.state.Whethertoverify===true?false:true, + // }) + // } else { + // console.log("706"); + // this.setState({ + // Phonenumberisnotco: undefined, + // Phonenumberisnotcobool: false, + // }) + // return + // } + // + // if (!regemail.test(e.target.value)) { + // if ((e.target.value.indexOf("@") != -1) === true) { + // stringdata = "邮箱格式不正确"; + // } else { + // stringdata = "手机号格式不正确"; + // + // } + // this.setState({ + // Phonenumberisnotco: stringdata, + // Phonenumberisnotcobool: true, + // dragOk:false, + // Whethertoverify:this.state.Whethertoverify===true?false:true, + // }) + // return + // } else { + // console.log("729"); + // this.setState({ + // Phonenumberisnotco: undefined, + // Phonenumberisnotcobool: false, + // }) + // this.Emailphonenumberverification(e.target.value, 1); + // return + // } this.Emailphonenumberverification(e.target.value, 1); } inputOnBlurzhuche = (e, id) => { 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 2/3] =?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 3/3] 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' },