$.ajax请求,请求头添加Token认证

var token = ${token};
$.ajax({
              type: "POST",
              url: "接口路径",
              async: false,
              data: JSON.stringify(jsonData),
              contentType: "application/json; charset=utf-8",
              dataType: "json",
              headers: {
                Authorization:token
              },
              success: function(data) {
                console.log(data);
              },
              error: function(e){
                console.log(e);
              }
        });

你可能感兴趣的:(java)