commit
This commit is contained in:
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"editor.fontSize": 18
|
||||||
|
}
|
||||||
@@ -39,13 +39,13 @@
|
|||||||
var password = document.getElementById("password").value;
|
var password = document.getElementById("password").value;
|
||||||
if (result != "user" || password != "user") {
|
if (result != "user" || password != "user") {
|
||||||
window.alert("使用者名稱或密碼不正確");
|
window.alert("使用者名稱或密碼不正確");
|
||||||
localStorage.setItem('LoginStatus, 0');
|
localStorage.setItem('LoginStatus', 0);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
window.alert("登入成功");
|
window.alert("登入成功");
|
||||||
window.location.assign('http://127.0.0.1:5500/mask.html');
|
window.location.assign('http://127.0.0.1:5500/mask.html');
|
||||||
localStorage.setItem('LoginStatus, 1');
|
localStorage.setItem('LoginStatus', 1);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
59
mask.html
Normal file
59
mask.html
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Document</title>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"
|
||||||
|
integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ=="
|
||||||
|
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<table border=1>
|
||||||
|
<tr>
|
||||||
|
<td>藥局名稱</td>
|
||||||
|
|
||||||
|
<td>成人口罩剩餘數量</td>
|
||||||
|
<td>兒童口罩剩餘數量</td>
|
||||||
|
</tr>
|
||||||
|
<tbody id="row">
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: 'https://findmasks.herokuapp.com/places',
|
||||||
|
type: 'get',
|
||||||
|
dataType: 'json',
|
||||||
|
success: function (data) {
|
||||||
|
|
||||||
|
|
||||||
|
for (i = 0; i < 20; i++) {
|
||||||
|
$("#row").append("<tr>"+"<td>" + data.features[i].properties.name + "</td>" +
|
||||||
|
"<td>" + data.features[i].properties.masksLeft + "</td>" +
|
||||||
|
"<td>" + data.features[i].properties.childMasksLeft + "</td>"+"</tr>")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
error: function (xhr) {
|
||||||
|
console.log('api catch error');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if(localStorage.getItem('LoginStatus')!=1){
|
||||||
|
alert('請重新登入後再試');
|
||||||
|
location.href='Untitled-1.html';
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user