|
|
@ -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, only: [:ps_new, :ps_update, :bs_new, :bs_update]
|
|
|
|
# before_filter :check_sign, only: [:ps_new, :ps_update, :bs_new, :bs_update]
|
|
|
|
|
|
|
|
|
|
|
|
before_filter :user_setup
|
|
|
|
before_filter :user_setup
|
|
|
|
# before_filter :require_login, only: [:authorize]
|
|
|
|
# before_filter :require_login, only: [:authorize]
|
|
|
@ -86,11 +86,11 @@ class EcloudController < ApplicationController
|
|
|
|
# if ecloud_user.present?
|
|
|
|
# if ecloud_user.present?
|
|
|
|
# render :json => {code: 500, msg: "你已开通过该业务"}
|
|
|
|
# render :json => {code: 500, msg: "你已开通过该业务"}
|
|
|
|
# else
|
|
|
|
# else
|
|
|
|
EcloudUser.create!(custid: params['custid'], opttype: user_param['opttype'], userid: user_param['userid'],
|
|
|
|
EcloudUser.create!(custid: params['custid'], opttype: user_param['opttype'], userid: user_param['userid'],
|
|
|
|
username: user_param['username'], useralias: user_param['useralias'],
|
|
|
|
username: user_param['username'], useralias: user_param['useralias'],
|
|
|
|
mobile: user_param['mobile'], email: user_param['email'], begintime: user_param['begintime'].to_s,
|
|
|
|
mobile: user_param['mobile'], email: user_param['email'], begintime: user_param['begintime'].to_s,
|
|
|
|
endtime: user_param['endtime'].to_s)
|
|
|
|
endtime: user_param['endtime'].to_s, status: 1)
|
|
|
|
render :json => {success: true, errmsg: ""}
|
|
|
|
render :json => {success: true, errmsg: ""}
|
|
|
|
# end
|
|
|
|
# end
|
|
|
|
rescue Exception => e
|
|
|
|
rescue Exception => e
|
|
|
|
logger.error(e.message)
|
|
|
|
logger.error(e.message)
|
|
|
@ -103,10 +103,10 @@ class EcloudController < ApplicationController
|
|
|
|
begin
|
|
|
|
begin
|
|
|
|
ecloud = Ecloud.where(applyno: params['applyno']).first
|
|
|
|
ecloud = Ecloud.where(applyno: params['applyno']).first
|
|
|
|
user_param = params['users'].first
|
|
|
|
user_param = params['users'].first
|
|
|
|
ecloud_user = ecloud.ecloud_user
|
|
|
|
ecloud_user = EcloudUser.where(userid: user_param['userid'], status: 1).first
|
|
|
|
|
|
|
|
|
|
|
|
ecloud_user.update_attributes(opttype: user_param['opttype'], userid: user_param['userid'])
|
|
|
|
ecloud_user.update_attributes(opttype: user_param['opttype'], userid: user_param['userid'], status: 0)
|
|
|
|
render :json => {success: true, errmsg: ""}
|
|
|
|
render :json => {success: true, errmsg: ""}
|
|
|
|
# else
|
|
|
|
# else
|
|
|
|
# render :json => {code: 404, msg: "企业ID不存在"}
|
|
|
|
# render :json => {code: 404, msg: "企业ID不存在"}
|
|
|
|
# end
|
|
|
|
# end
|
|
|
|