-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcors_test.html
More file actions
34 lines (32 loc) · 988 Bytes
/
cors_test.html
File metadata and controls
34 lines (32 loc) · 988 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
<button onclick="getMaps()">getMaps</button>
<div class="info"></div>
<script>
var host = 'http://api.atlasdata.cn/';
var token = "eyJpZCI6InNodW4ifQ.69ncA--qjdXrEXxMF3WDBlCKfLv_OigFLS27a2ATE_A";
$.ajax({
method: 'GET',
url: host + 'maps/?public=true',
contentType: 'application/json;language=utf-8',
xhrFields: {
withCredentials: true,
},
headers: {
Authorization: 'Bearer ' + token
},
success: function(res) {
console.log(res)
}
});
</script>
</body>
</html>