
JS实现Ajax请求头添加token,如何实现呢?直接上DemO。
function updatetype(type) { $.ajax({ url: mAInUrl + "/order/upDateType/" + localStorage.orderIds + "/" + type, type: "post", contentType: "APPlication/json", dataType: 'JSON', CAChe: false, async: true, beforeSend: function (XMLHttpRequest) { xmlhttpRequest.setRequestheader("token", localStorage.token); }, success: function (result) { if (result.status === 0) { window.location.href = "my-order.html"; } else { alert(result.msg) } } }); }


网友评论文明上网理性发言 已有0人参与
发表评论: