dev_SaaS
cxt 6 years ago
commit 5adf21dffc

@ -5,7 +5,7 @@ require 'digest'
class EcloudController < ApplicationController class EcloudController < ApplicationController
skip_before_filter :verify_authenticity_token skip_before_filter :verify_authenticity_token
before_filter :check_sign # before_filter :check_sign
before_filter :user_setup before_filter :user_setup
before_filter :require_login, only: [:authorize] before_filter :require_login, only: [:authorize]
@ -20,10 +20,8 @@ class EcloudController < ApplicationController
def trustie_login def trustie_login
end end
# CLIENT_ID = '1022' CLIENT_ID = '1022'
CLIENT_ID = '124124' CLIENT_SECRET = '2112037a-6d7a-432b-9081-feb1153d8668'
CLIENT_SECRET = '72ff7f4e-9b2e-4b33-8232-07cb0d08bbf3'
# CLIENT_SECRET = '2112037a-6d7a-432b-9081-feb1153d8668'
ROOT_URl = 'http://localhost:3000' ROOT_URl = 'http://localhost:3000'
SERVER_URL = "https://221.176.54.92:9081/restful/services/" SERVER_URL = "https://221.176.54.92:9081/restful/services/"
@ -64,11 +62,11 @@ class EcloudController < ApplicationController
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
begin begin
ecloud = Ecloud.where(custid: params['custid']).first ecloud = Ecloud.where(custid: params['custid']).first
ecloud.update_attribute(applyno: params['applyno'], ecordercode: params['ecordercode'], opttype: params['opttype'], ecloud.update_attributes!(applyno: params['applyno'], ecordercode: params['ecordercode'], opttype: params['opttype'],
custid: params['custid'], custcode: params['custcode'], productcode: params['productcode'], custid: params['custid'], custcode: params['custcode'], productcode: params['productcode'],
operatime: params['operatime'], effecttime: params['effecttime']) operatime: params['operatime'], effecttime: params['effecttime'])
services = params['ervices'].first services = params['ervices'].first
ecloud.ecloud_services.update_attributes(packagecode: services['packagecode'], bossorderid: services['bossorderid']) ecloud.ecloud_services.update_attributes!(packagecode: services['packagecode'], bossorderid: services['bossorderid'])
rescue Exception => e rescue Exception => e
logger.error(e.message) logger.error(e.message)
@ -189,8 +187,6 @@ class EcloudController < ApplicationController
private private
def check_sign def check_sign
sign = sign(params['timestamp']) sign = sign(params['timestamp'])
logger.info("######@2222#{sign}")
logger.info("######@2222#{params['sign']}")
if sign != params['sign'] if sign != params['sign']
render :json => {code: 501, msg: "sign的值错误"} render :json => {code: 501, msg: "sign的值错误"}
return return

@ -35,9 +35,9 @@ RedmineApp::Application.routes.draw do ## oauth相关
get 'ecloud/ecloud_login', to: 'ecloud#ecloud_login_callback' get 'ecloud/ecloud_login', to: 'ecloud#ecloud_login_callback'
post 'ecloud/bs_new', to: 'ecloud#bs_new' post 'ecloud/bs_new', to: 'ecloud#bs_new'
post 'ecloud/bs_edit', to: 'ecloud#bs_update' post 'ecloud/bs_update', to: 'ecloud#bs_update'
post 'ecloud/ps_new', to: 'ecloud#ps_new' post 'ecloud/ps_new', to: 'ecloud#ps_new'
post 'ecloud/ps_edit', to: 'ecloud#ps_update' post 'ecloud/ps_update', to: 'ecloud#ps_update'
resources :ec_course_evaluations do resources :ec_course_evaluations do

Loading…
Cancel
Save