在请求时将async设置为false即可
$.ajax({
type: "post",
async: false,
url: '/test',
data: data,
success: function (data) {
alert(data);
}
});