|
|
|
@ -448,6 +448,25 @@ class ApplicationController < ActionController::Base
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 无参类型处理
|
|
|
|
|
def interface_get(uri, status, message)
|
|
|
|
|
begin
|
|
|
|
|
uid_logger_dubug("--uri_exec: url is #{uri}")
|
|
|
|
|
uri = URI.parse(URI.encode(uri.strip))
|
|
|
|
|
res = Net::HTTP.get(uri).body
|
|
|
|
|
uid_logger_dubug("--uri_exec: .....res is #{res}")
|
|
|
|
|
res = JSON.parse(res)
|
|
|
|
|
if (res && res['code'] != 0)
|
|
|
|
|
tip_exception(status, message)
|
|
|
|
|
else
|
|
|
|
|
res
|
|
|
|
|
end
|
|
|
|
|
rescue Exception => e
|
|
|
|
|
uid_logger("--uri_exec: exception #{e.message}")
|
|
|
|
|
raise Educoder::TipException.new(message)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# json格式请求
|
|
|
|
|
def interface_json_post(uri, params, status, message)
|
|
|
|
|
begin
|
|
|
|
|