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