ADD ajax request headers

This commit is contained in:
Jasder 2019-10-24 16:31:51 +08:00
parent 6fef889e19
commit fbfe908d46
1 changed files with 14 additions and 8 deletions

View File

@ -25,7 +25,7 @@
<% else %> <% else %>
<%= link_to "重新分析", quality_analysis_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :default_branch => @g_default_branch, :type => "2"), :remote => true, :class => "btn_zipdown fl ml10" %> <%= link_to "重新分析", quality_analysis_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :default_branch => @g_default_branch, :type => "2"), :remote => true, :class => "btn_zipdown fl ml10" %>
<% end %> <% end %>
<% if @project.id == 5787 %> <% if true %>
<%= link_to '云端编程', "http://106.75.119.131:8080/dashboard/#/ide/che/trustie_che_demo", :class => "btn_zipdown fl ml10"%> <%= link_to '云端编程', "http://106.75.119.131:8080/dashboard/#/ide/che/trustie_che_demo", :class => "btn_zipdown fl ml10"%>
<%= link_to '云端部署', "javascript:void(0)", :class => "btn_zipdown fl ml10", :onclick => "deploy()"%> <%= link_to '云端部署', "javascript:void(0)", :class => "btn_zipdown fl ml10", :onclick => "deploy()"%>
<% end %> <% end %>
@ -80,13 +80,19 @@
<script type="text/javascript"> <script type="text/javascript">
var i=0; var i=0;
function deploy(){ function deploy(){
$.ajax({ if (i == 0) {
url: 'http://106.75.6.173:8080/job/socks-shop/build?token=socks-shop', $.ajax({
type:'get', url: 'http://106.75.6.173:8080/job/socks-shop/build?token=socks-shop&j_username=jenkins&j_password=123',
success: function(){ }, type:'get',
beforeSend: function(){ }, contentType: "application/json; charset=utf-8",
complete: function(){ } success: function(){
}); console.log('request success!')
},
beforeSend: function(){ },
complete: function(){ }
});
}
i++; i++;
if(i<11) { if(i<11) {
$("#deploy-loading").show() $("#deploy-loading").show()