Class: Wireway::RestfulController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Wireway::RestfulController
- Defined in:
- app/controllers/wireway/restful_controller.rb
Instance Method Summary collapse
Instance Method Details
#request_api ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'app/controllers/wireway/restful_controller.rb', line 3 def request_api # TODO 初步了解为rails5的安全机制 去除存在风险 暂时先这样 args = params.permit!.to_hash.reject!{|key| ["action", "controller"].include?(key)}.deep_symbolize_keys res = Wireway::Spark.send(args[:platform], args) tmp = {success: res[0], result: res[1]} (tmp.merge!(res[2]) rescue nil) if res[2].present? render json: tmp.merge!(tmp) end |