parent
13eb4069fe
commit
a30853f7be
@ -1,42 +0,0 @@
|
||||
<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>
|
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
Loading…
Reference in New Issue