|
|
@ -1,4 +1,5 @@
|
|
|
|
class TrialAppliesController < ApplicationController
|
|
|
|
class TrialAppliesController < ApplicationController
|
|
|
|
|
|
|
|
before_action :require_user_login
|
|
|
|
|
|
|
|
|
|
|
|
def create
|
|
|
|
def create
|
|
|
|
Users::ApplyTrailService.call(current_user, create_params)
|
|
|
|
Users::ApplyTrailService.call(current_user, create_params)
|
|
|
@ -12,4 +13,10 @@ class TrialAppliesController < ApplicationController
|
|
|
|
def create_params
|
|
|
|
def create_params
|
|
|
|
params.permit(:phone, :code, :reason).merge(remote_ip: request.remote_ip)
|
|
|
|
params.permit(:phone, :code, :reason).merge(remote_ip: request.remote_ip)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def require_user_login
|
|
|
|
|
|
|
|
return if User.current.logged?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
render_unauthorized
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|