From 7f8a4dbe8724599bd4b4c626a5564c6e25de8938 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, 17 Jul 2019 19:54:26 +0800 Subject: [PATCH 1/5] =?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/views/libraries/_form.html.erb | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/app/views/libraries/_form.html.erb b/app/views/libraries/_form.html.erb index 9904f602..e102e8d4 100644 --- a/app/views/libraries/_form.html.erb +++ b/app/views/libraries/_form.html.erb @@ -23,6 +23,7 @@ <%= f.text_field :author_name, placeholder: '请输入姓名', class: 'greyInput winput-300-35 mr20 fl winput150', width: '163', size: 30 %>
请输入姓名
+ 字数不能超过10个字请输入作者单位名称
@@ -151,13 +152,13 @@ $("#title_notice").addClass("none"); } - if (!title || title.length >10) { - $("#title_notice").removeClass("none"); - $("#title_notice").html("字数不能超过10个字"); - return - }else{ - $("#title_notice").addClass("none"); - } + // if (!title || title.length >10) { + // $("#title_notice").removeClass("none"); + // $("#title_notice").html("字数不能超过10个字"); + // return + // }else{ + // $("#title_notice").addClass("none"); + // } if (!content || content.length == 0) { @@ -166,13 +167,24 @@ }else{ $("#des_notice").addClass("none"); } + + if (!author_name || author_name.length == 0) { $("#author_name_notice").removeClass("none"); return }else{ $("#author_name_notice").addClass("none"); } - if (!author_school_name || author_school_name.length == 0) { + + if (!author_name || author_name.length >10) { + $("#title_author_name").removeClass("none"); + return + }else{ + $("#title_author_name").addClass("none"); + } + + + if (!author_school_name || author_school_name.length == 0) { $("#author_school_name_notice").removeClass("none"); return }else{ From 913c5c581db1b947af0c90a5259087bcef9d0ff7 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, 17 Jul 2019 19:59:42 +0800 Subject: [PATCH 2/5] b --- public/react/src/modules/tpm/NewHeader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 42dcaf78..a9d24340 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -299,12 +299,12 @@ class NewHeader extends Component {请输入姓名
请输入作者单位名称
From f8eff25139e8cfa3d9ab2715be604e4b53fe83f4 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 18 Jul 2019 08:41:31 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=BC=95=E6=B5=81=E7=9A=84=E8=A1=8C=E4=B8=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/account_controller.rb | 8 ++++---- app/controllers/competition_teams_controller.rb | 12 ++++-------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index cb556f8d..eb4f1a82 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -377,10 +377,10 @@ class AccountController < ApplicationController else us = UsersService.new @user = us.register user_params.merge(:should_confirmation_password => false) - # # 注册时,记录是否是引流用户 - # ip = request.remote_ip - # ua = UserAgent.find_by_ip(ip) - # ua.update_column(:type, UserAgent::REGISTER) if ua + # 注册时,记录是否是引流用户 + ip = request.remote_ip + ua = UserAgent.find_by_ip(ip) + ua.update_column(:type, UserAgent::REGISTER) if ua if !@user.new_record? self.logged_user = @user flash[:notice] = l(:notice_account_activated) diff --git a/app/controllers/competition_teams_controller.rb b/app/controllers/competition_teams_controller.rb index b23ec5d6..9159cf07 100644 --- a/app/controllers/competition_teams_controller.rb +++ b/app/controllers/competition_teams_controller.rb @@ -114,9 +114,7 @@ class CompetitionTeamsController < ApplicationController new_team.team_members.create!(user_id: user_id, role: 3, competition_id: @competition.id, is_teacher: 1) end # 创建时,记录是否是引流用户 - # ip = request.remote_ip - # ua = UserAgent.find_by_ip(ip) - # ua.update_column(:type, UserAgent::COMPETITION) if ua + record_agent_user_action end end @@ -230,10 +228,8 @@ class CompetitionTeamsController < ApplicationController end team.team_members.create!(user_id: User.current.id, role: 2, competition_id: @competition.id) - # # 创建时,记录是否是引流用户 - # ip = request.remote_ip - # ua = UserAgent.find_by_ip(ip) - # ua.update_column(:type, UserAgent::COMPETITION) if ua + # 记录引流 + record_agent_user_action end end @@ -351,7 +347,7 @@ class CompetitionTeamsController < ApplicationController end def record_agent_user_action - # 注册时,记录是否是引流用户 + # 记录是否是引流用户的行为 ip = request.remote_ip ua = UserAgent.find_by_ip(ip) ua.update_column(:type, UserAgent::COMPETITION) if ua