From bbf419ef80018e1664a3d0688e6963e844b6bd91 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 23 Aug 2019 15:48:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=89=88=E8=B4=A6=E5=8F=B7?= =?UTF-8?q?=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/accounts_controller.rb | 2 +- app/controllers/application_controller.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index e62dcf6ed..d6b4068cb 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -33,7 +33,7 @@ class AccountsController < ApplicationController 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" - unless code == "513231" && request.host == "47.96.87.25" + unless code == "513231" && request.domain == "pre-newweb.educoder.net" return normal_status(-2, "验证码不正确") if verifi_code.try(:code) != code.strip return normal_status(-2, "验证码已失效") if !verifi_code&.effective? end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 233d94c8f..ac9d63346 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -245,7 +245,8 @@ class ApplicationController < ActionController::Base # 测试版前端需求 - if request.host == "47.96.87.25" + logger.info("#########domain:#{request.domain}") + if request.domain == "pre-newweb.educoder.net" if params[:debug] == 'teacher' #todo 为了测试,记得讲debug删除 User.current = User.find 81403 elsif params[:debug] == 'student'