dev_SaaS
huang 6 years ago
commit dcec874401

@ -192,28 +192,30 @@ class EcloudController < ApplicationController
private
def get(url)
uri = URI(url)
res = Net::HTTP.start(uri.host, uri.port, use_ssl: url.start_with?('https')) do |http|
req = Net::HTTP::Get.new(uri)
#req['Content-Type'] = 'application/json'
# The body needs to be a JSON string, use whatever you know to parse Hash to JSON
#req.body = {a: 1}.to_json
http.request(req)
end
res.body
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = url.start_with?('https')
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(uri.request_uri)
request['Content-Type'] = 'application/json'
request['Accept'] = 'application/json'
response = http.request(request)
response.body
end
def post(url)
uri = URI(url)
res = Net::HTTP.start(uri.host, uri.port, use_ssl: url.start_with?('https')) do |http|
req = Net::HTTP::Post.new(uri)
#req['Content-Type'] = 'application/json'
# The body needs to be a JSON string, use whatever you know to parse Hash to JSON
#req.body = {a: 1}.to_json
http.request(req)
end
res.body
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = url.start_with?('https')
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(uri.request_uri)
request['Content-Type'] = 'application/json'
request['Accept'] = 'application/json'
response = http.request(request)
response.body
end
def decode(s)

@ -51,23 +51,12 @@
</div>
</div>
</div>
<!--精选实训-->
<div class="clearfix pt20 educontent pr pb20">
<div class="edu-txt-center">
<p class="color-dark edu-txt-center font-24" style="line-height: 30px">精选实训</p>
<p class="color-grey-cd font-12">SELECTED TRAINING</p>
</div>
<a href="<%= shixuns_path %>" class="moreitem">更多<i class="fa fa-angle-right ml5"></i></a>
<div class="square-list clearfix">
<%= render :partial => "shixuns/shixun_item", :locals => {:shixuns => @shixuns} %>
</div>
</div>
<!--实训路径-->
<div class="clearfix pt20 educontent pr pb20 mb60">
<div class="edu-txt-center">
<p class="color-dark edu-txt-center font-24" style="line-height: 30px">实训课程</p>
<p class="color-grey-cd font-12">TRAINING PATH</p>
<p class="color-grey-cd font-12">TRAINING COURSE</p>
</div>
<a href="<%= subjects_path() %>" class="moreitem">更多<i class="fa fa-angle-right ml5"></i></a>
<div class="square-list clearfix">
@ -77,6 +66,20 @@
<!--<a href="https://www.educoder.net/paths/4" target="_blank"><img src="/images/educoder/guagngao.png" width="100%"/></a>-->
</div>
<!--精选实训 改为 开发社区-->
<div class="clearfix pt20 educontent pr pb20">
<div class="edu-txt-center">
<p class="color-dark edu-txt-center font-24" style="line-height: 30px">开发社区</p>
<p class="color-grey-cd font-12">DEVELOPMENT COMMUNITY</p>
</div>
<a href="<%= shixuns_path %>" class="moreitem">更多<i class="fa fa-angle-right ml5"></i></a>
<div class="square-list clearfix">
<%= render :partial => "shixuns/shixun_item", :locals => {:shixuns => @shixuns} %>
</div>
</div>
<!--导师排行榜-->
<div class="pt60 pb60 mb30 mentor-ranking">
<div class="educontent">

Loading…
Cancel
Save