You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.6 KiB
HTML
42 lines
1.6 KiB
HTML
<html>
|
|
<head>
|
|
<title>demo</title>
|
|
<script src="Scripts/jquery-1.10.2.js"></script>
|
|
<script>
|
|
$(function () {
|
|
var token = "";
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "http://47.102.46.73:8081/api/Account/Login",
|
|
dataType: "json",
|
|
contentType: "application/json",
|
|
data: JSON.stringify({ "userName": "wanggaofeng", "userPassword": "213464", "project": "HAYY", "role": "", "clientType": 1 }),
|
|
success: function (jsonData) {
|
|
token = jsonData.data[0].token;
|
|
$.ajax({
|
|
type: "GET",
|
|
url: "http://47.102.46.73:8081/api/Elevator/GetOverView?sys=5",
|
|
dataType: "json",
|
|
contentType: "application/json",
|
|
//方法一
|
|
headers: {},
|
|
//方法二
|
|
beforeSend: function (request) {
|
|
request.setRequestHeader("Authorization", "Bearer " + token);
|
|
},
|
|
success: function (jsonData) {
|
|
var text = JSON.stringify(jsonData);
|
|
$("#JsonShow").html(text);
|
|
}
|
|
});
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
</head>
|
|
<bod>
|
|
<div id="App">
|
|
<pre id="JsonShow"></pre>
|
|
</div>
|
|
</bod>
|
|
</html> |