From 5d5f0f42c0b701c2e4a3c53fc49254e1a76c615c Mon Sep 17 00:00:00 2001 From: Jasder <2053003901@@qq.com> Date: Tue, 24 Nov 2020 11:30:01 +0800 Subject: [PATCH] FIX local register bug --- app/controllers/accounts_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index a4b1d35ec..03d81d5c9 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -130,13 +130,13 @@ class AccountsController < ApplicationController pre = 'm' email = params[:login] phone = nil + return normal_status(-1, "该邮箱已注册") if User.exists?(mail: params[:login]) + return normal_status(-1, "邮箱格式错误") unless params[:login] =~ CustomRegexp::EMAIL # verifi_code = VerificationCode.where(email: email, code: code, code_type: 8).last end # uid_logger("start register: verifi_code is #{verifi_code}, code is #{code}, time is #{Time.now.to_i - verifi_code.try(:created_at).to_i}") # check_code = (verifi_code.try(:code) == code.strip && (Time.now.to_i - verifi_code.created_at.to_i) <= 10*60) # todo 上线前请删除万能验证码"513231" - return normal_status(-1, "该邮箱已注册") if User.exists?(mail: params[:login]) - return normal_status(-1, "邮箱格式错误") unless params[:login] =~ CustomRegexp::EMAIL return normal_status(-1, "8~16位密码,支持字母数字和符号") unless params[:password] =~ CustomRegexp::PASSWORD code = generate_identifier User, 8, pre