2024-07-22新BI页面
LiuJiaNan 2024-07-23 08:35:27 +08:00
parent aa4f52ad2a
commit 77f41320c8
1 changed files with 29 additions and 1 deletions

View File

@ -108,7 +108,7 @@
<input id="username" placeholder="请输入用户名"></input>
<label for="password">密码</label>
<input id="password" type="password" placeholder="请输入密码"></input>
<button>登录</button>
<button onclick="login()">登录</button>
</div>
</div>
<div class="footer">
@ -116,4 +116,32 @@
</div>
</div>
</body>
<script>
function login() {
let username = document.getElementById('username').value
let password = document.getElementById('password').value
if (!username && !password) {
alert('请输入账号和密码')
} else {
fetch('/ysapi/login', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
username,
password
})
}).then(res => {
return res.json()
}).then(res => {
if (res.code === 200) {
// window.open('')
} else {
alert(res.msg)
}
})
}
}
</script>
</html>