file name change
This commit is contained in:
62
api_prac.html
Normal file
62
api_prac.html
Normal file
@@ -0,0 +1,62 @@
|
||||
<!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>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="wrap">
|
||||
<form action="form.html" onsubmit="return checkUser();">
|
||||
<label for="account">帳號</label>
|
||||
<input type="account" name="account" id="account"><br>
|
||||
<label for="password">密碼</label>
|
||||
<input type="password" name="password" id="password"> <br>
|
||||
<div id="btn">
|
||||
<input type="button" value="登入" class="login">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
|
||||
localStorage.clear();
|
||||
|
||||
var logInBtn = document.querySelector(".login");
|
||||
logInBtn.addEventListener("click", checkUser, false);
|
||||
|
||||
|
||||
function checkUser() {
|
||||
var result = document.getElementById("account").value;
|
||||
var password = document.getElementById("password").value;
|
||||
if (result != "user" || password != "user") {
|
||||
window.alert("使用者名稱或密碼不正確");
|
||||
localStorage.setItem('LoginStatus', 0);
|
||||
|
||||
return false;
|
||||
} else {
|
||||
window.alert("登入成功");
|
||||
window.location.assign('http://127.0.0.1:5500/mask.html');
|
||||
localStorage.setItem('LoginStatus', 1);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user