Merge branch 'dev_aliyun' into dev_tj

merge aliyun
dev_new_shixunsrepository
tangjiang 5 years ago
commit e4446a1ff3

@ -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'
@ -1336,6 +1337,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

@ -7,8 +7,6 @@ import { broadcastChannelOnmessage ,SetAppModel, isDev, queryString } from 'educ
import { notification } from 'antd'; import { notification } from 'antd';
import './index.css'; import './index.css';
const opens ="79e33abd4b6588941ab7622aed1e67e8"; const opens ="79e33abd4b6588941ab7622aed1e67e8";
let timestamp = Date.parse(new Date());
const newopens=md5(opens+timestamp)
broadcastChannelOnmessage('refreshPage', () => { broadcastChannelOnmessage('refreshPage', () => {
window.location.reload() window.location.reload()
}) })
@ -94,6 +92,8 @@ export function initAxiosInterceptors(props) {
} }
} }
if(`${config[0]}`!=`true`){ if(`${config[0]}`!=`true`){
let timestamp = Date.parse(new Date())/1000;
let newopens=md5(opens+timestamp)
if (window.location.port === "3007") { if (window.location.port === "3007") {
config.url = `${proxy}${url}`; config.url = `${proxy}${url}`;
if (config.url.indexOf('?') == -1) { if (config.url.indexOf('?') == -1) {

Loading…
Cancel
Save