Merge remote-tracking branch 'origin/dev_aliyun' into dev_aliyun

dev_static
杨树明 5 years ago
commit da9807de90

@ -185,6 +185,9 @@ class AccountsController < ApplicationController
send_type = verify_type(login_type, type)
verification_code = code.sample(6).join
sign = Digest::MD5.hexdigest("#{OPENKEY}#{value}")
tip_exception(501, "请求不合理") if sign != params[:smscode]
logger.info("########get_verification_code: login_type #{login_type} send_type#{send_type}, ")
# 记录验证码

@ -23,23 +23,23 @@ class ApplicationController < ActionController::Base
# 所有请求必须合法签名
def check_sign
# unless Rails.env.development?
# Rails.logger.info("66666 #{params}")
# suffix = request.url.split(".").last.split("?").first
# suffix_arr = ["xls", "xlsx", "pdf"] # excel文件先注释
# unless suffix_arr.include?(suffix)
# if params[:client_key].present?
# randomcode = params[:randomcode]
# # tip_exception(501, "请求不合理") unless (Time.now.to_i - randomcode.to_i).between?(0,5)
#
# sign = Digest::MD5.hexdigest("#{OPENKEY}#{randomcode}")
# Rails.logger.info("2222 #{sign}")
# tip_exception(501, "请求不合理") if sign != params[:client_key]
# else
# tip_exception(501, "请求不合理")
# end
# end
# end
if !Rails.env.development? && EduSetting.get("host_name") != "https://test-newweb.educoder.net"
Rails.logger.info("66666 #{params}")
suffix = request.url.split(".").last.split("?").first
suffix_arr = ["xls", "xlsx", "pdf"] # excel文件先注释
unless suffix_arr.include?(suffix)
if params[:client_key].present?
randomcode = params[:randomcode]
# tip_exception(501, "请求不合理") unless (Time.now.to_i - randomcode.to_i).between?(0,5)
sign = Digest::MD5.hexdigest("#{OPENKEY}#{randomcode}")
Rails.logger.info("2222 #{sign}")
tip_exception(501, "请求不合理") if sign != params[:client_key]
else
tip_exception(501, "请求不合理")
end
end
end
end
# 全局配置参数

Loading…
Cancel
Save