12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/fastlane/plugin/zhuixi_build_app/actions/get_pack_config_action.rb', line 12
def self.get_pack_config(game_id)
uri = URI.parse("http://xg.yutennet.com/issuesy/pack/doPack")
request = Net::HTTP::Post.new(uri)
request.content_type = "application/json"
request.body = JSON.dump({
"user_id" => lane_context[:user_id],
"token" => lane_context[:token],
"packet_os" => "2",
"platform_id" => lane_context[:platform_id],
"game_id" => game_id,
})
response = Net::HTTP.start(uri.hostname, uri.port) do |http|
puts request.body
http.request(request)
end
if response.code == "200"
result = JSON.parse(response.body)
if result["code"] == 200
data = result["data"]
lane_context[:configParams] = data["config"]
resourcesUrl = data["resources_url"]
return resourcesUrl.to_s
else
puts "获取打包配置失败:\n#{result}"
end
else
puts "获取打包配置失败:HTTP\n #{response}"
end
end
|