您可以使用以下更改ajax:request.getResponseHeader(\'your_header\')
$.ajax({
type: \'POST\',
url:\'api-url.php\',
data: formData,
success: function(data, textStatus, request){
alert(request.getResponseHeader(\'your_header\'));
},
error: function (request, textStatus, errorThrown) {
alert(request.getResponseHeader(\'your_header\'));
}
});