ecloud auth

dev_local
jingquan huang 6 years ago
parent a3b14f86ca
commit 9fee0222ba

@ -17,7 +17,7 @@ require 'digest'
class EcloudController < ApplicationController
skip_before_filter :verify_authenticity_token
before_filter :check_sign, only: [:ps_new, :ps_update, :bs_new, :bs_update]
# before_filter :check_sign, only: [:ps_new, :ps_update, :bs_new, :bs_update]
before_filter :save_para
before_filter :user_setup
@ -105,6 +105,8 @@ class EcloudController < ApplicationController
des_services = params['services'].select{|s| s['opttype'] == 1}
if des_services.present?
des_services.each do |ds|
logger.info("666666#{ecloud.try(:id)}, 55555555#{ds['code']}")
esd = EcloudService.where(ecloud_id: ecloud.try(:id), code: ds['code']).first
esd.update_attributes!(opttype: ds['opttype'], begintime: ds['begintime'], endtime: ds['endtime'])
end
@ -144,10 +146,10 @@ class EcloudController < ApplicationController
# end
render :json => {result: true, errmsg: ""}
rescue Exception => e
logger.error(e.message)
render :json => {code: 500, msg: "#{e.message}"}
raise ActiveRecord::Rollback
# rescue Exception => e
# logger.error(e.message)
# render :json => {code: 500, msg: "#{e.message}"}
# raise ActiveRecord::Rollback
end
end
end

Loading…
Cancel
Save