From d2c112469f7099c1efb2c63c01c098fd2107c9ea Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Sat, 20 Jul 2019 20:31:55 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E7=99=BB=E5=BD=95=E8=A7=84=E8=8C=83?= =?UTF-8?q?=E6=A3=80=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 6a7599f28..732ff781c 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -46,7 +46,9 @@ class ApplicationController < ActionController::Base # 判断用户的邮箱或者手机是否可用 # params[:type] 1: 注册;2:忘记密码 def check_mail_and_phone_valid login, type - unless login =~ /^[a-zA-Z0-9]+([._\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/ || login =~ /^1\d{10}$/ + unless login =~ /^[a-zA-Z0-9]+([._\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/ || login =~ /^1\d{10}$/ || + login =~ /^[a-zA-Z0-9]+([._\\]*[a-zA-Z0-9])$/ +end tip_exception(-2, "请输入正确的手机号或邮箱") end # 考虑到安全参数问题,多一次查询,去掉Union From f9fd499bb0208b1db9d058fba82da49f6571b7e5 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 20 Jul 2019 20:35:00 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E8=AF=95=E7=94=A8=E7=94=B3=E8=AF=B7?= 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 5666884e9..ac08fdf86 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -186,7 +186,7 @@ class ApplicationController < ActionController::Base # 系统全局认证 def check_auth if current_user.certification != 1 && current_user.apply_actions.exists?(container_type: 'TrialAuthorization', status: 0) - tip_exception(-1, "您的试用申请正在审核中,请耐心等待") + tip_exception(408, "您的试用申请正在审核中,请耐心等待") elsif current_user.certification != 1 day_cer = UserDayCertification.find_by(user_id: current_user.id) tip_exception(407, "系统未授权") unless (Time.now.to_i - day_cer.try(:created_at).to_i) < 86400 From b26a9fc03d709a46fa3283d42ef382d274cf5cf3 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Sat, 20 Jul 2019 20:38:53 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E7=99=BB=E5=BD=95=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=E6=AD=A3=E5=88=99=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 0862892bb..b1c36c7bf 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -48,7 +48,6 @@ class ApplicationController < ActionController::Base def check_mail_and_phone_valid login, type unless login =~ /^[a-zA-Z0-9]+([._\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/ || login =~ /^1\d{10}$/ || login =~ /^[a-zA-Z0-9]+([._\\]*[a-zA-Z0-9])$/ -end tip_exception(-2, "请输入正确的手机号或邮箱") end # 考虑到安全参数问题,多一次查询,去掉Union From 601c9eadf4a88ce83cea7d5692dc7aab08886374 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 20 Jul 2019 20:49:23 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/routes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/routes.rb b/config/routes.rb index a5742494d..cabdcb18e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -80,7 +80,7 @@ Rails.application.routes.draw do resource :email_bind, only: [:create] resource :password, only: [:update] resource :avatar, only: [:update] - resource :auth_attachment, only: [:update] + resource :auth_attachment, only: [:create] resource :authentication_apply, only: [:create] resource :professional_auth_apply, only: [:create] end From 160a5372785c96fba715704e1add97c82d9b6c58 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Sat, 20 Jul 2019 21:02:13 +0800 Subject: [PATCH 5/6] fix --- app/controllers/users/auth_attachments_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/users/auth_attachments_controller.rb b/app/controllers/users/auth_attachments_controller.rb index 86c3e70ef..98eff078f 100644 --- a/app/controllers/users/auth_attachments_controller.rb +++ b/app/controllers/users/auth_attachments_controller.rb @@ -1,8 +1,8 @@ class Users::AuthAttachmentsController < Users::BaseAccountController before_action :private_user_resources! - before_action :convert_image!, only: [:update] + before_action :convert_image!, only: [:create] - def update + def create image_temp_path = auth_image_path + 'temp' # 上传文件保存至临时文件,提交申请时再移到正常目录 File.delete(image_temp_path) if File.exist?(image_temp_path) # 删除之前的临时文件 From fdb2380face9d956ea273f8b63efa9ef5361fc96 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 20 Jul 2019 21:22:06 +0800 Subject: [PATCH 6/6] =?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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 4685c9f69..8e4b888a1 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -196,7 +196,7 @@ class HomeworkCommonsController < ApplicationController if params[:format] == "xlsx" if @user_course_identity >= Course::STUDENT tip_exception(403, "无权限操作") - elsif @work_excel.size == 0 + elsif @work_excel.blank? || @work_excel.size == 0 normal_status(-1,"暂无用户提交!") else respond_to do |format|