demo如下:
<html>
<head>
<meta charset="utf-8">
<title>request</title>
</head>
<body>
<button onclick="btn()">按钮</button>
</body>
<script src="jquery-3.3.1.min.js"></script>
<script>
function btn() {
var token = "6oFm0_4wp65v55CFuc4er41_qaZ6cYOv_1550458274";
$.ajax({
type:"GET",
contentType: "application/json",
url:"http://api.luckymoney.com/admin/members",
beforeSend:function (request) {
request.setRequestHeader("token", token);
},
success:function (res) {
console.log(res);
}
});
}
</script>
</html>