Merge branch 'dev_aliyun' into dev_cxt

dev_cxt
cxt 5 years ago
commit dc7e1331ce

@ -27,8 +27,7 @@ class ApplicationController < ActionController::Base
if params[:client_key].present? if params[:client_key].present?
Rails.logger.info("111111 #{params[:client_key]}") Rails.logger.info("111111 #{params[:client_key]}")
Rails.logger.info("00000 #{params[:timestamp]}") Rails.logger.info("00000 #{params[:timestamp]}")
Rails.logger.info("Time.now - params[:timestamp].to_i: #{Time.now.to_i - params[:timestamp].to_i}") tip_exception(501, "请求不合理") unless (Time.now.to_i - params[:timestamp].to_i).between?(0,5)
tip_exception(501, "请求超时") unless (Time.now.to_i - params[:timestamp].to_i).between?(0,5)
timestamp = params[:timestamp] timestamp = params[:timestamp]
sign = Digest::MD5.hexdigest("#{OPENKEY}#{timestamp}") sign = Digest::MD5.hexdigest("#{OPENKEY}#{timestamp}")
Rails.logger.info("2222 #{sign}") Rails.logger.info("2222 #{sign}")

@ -3,6 +3,10 @@ class Ecs::HomesController < Ecs::BaseController
@school_managers = current_school.users @school_managers = current_school.users
end end
def first_stamp
render :json => { status: 0, message: Time.now.to_i }
end
private private
def current_school def current_school

@ -15,6 +15,7 @@ Rails.application.routes.draw do
scope '/api' do scope '/api' do
get 'home/index' get 'home/index'
get 'home/search' get 'home/search'
get 'home/first_stamp'
get 'search', to: 'searchs#index' get 'search', to: 'searchs#index'
@ -1337,6 +1338,7 @@ Rails.application.routes.draw do
root 'main#index' root 'main#index'
## react用 ## react用
get '*path', to: 'main#index', constraints: ReactConstraint.new get '*path', to: 'main#index', constraints: ReactConstraint.new
end end

Loading…
Cancel
Save