This commit is contained in:
chenyang
2022-07-01 07:30:07 +08:00
parent c7cc3cc5c4
commit 132432c7d5
3 changed files with 16 additions and 12 deletions
+10 -7
View File
@@ -24,16 +24,16 @@
$(function () {
// 监听modal窗口事件
$('#exampleModal').on('show.bs.modal', function (event) {
console.log(qr_websocket)
console.log('打开');
// console.log(qr_websocket)
// console.log('打开');
const ws = new WebSocket(`ws://${window.location.host}/ws/qr/?${qr_websocket.uuid}`)
ws.onmessage = function (e) {
console.log(e.data)
console.log('接收到websocket消息:' + e.data)
}
qr_websocket.websocket = ws
});
$('#exampleModal').on('hidden.bs.modal', function (event) {
console.log('关闭');
// console.log('关闭');
qr_websocket.websocket.close()
});
@@ -89,7 +89,10 @@
data: {userName: userName, inputPassword: inputPassword},
dataType: "json",
success: function (data) {
console.log(data)
// 注册成功
if (data.code === 0) {
}
},
async: false
});
@@ -150,7 +153,7 @@
<div class="modal-body register_group" style="display: none;height: 360px;">
<h1 class="h3 mb-3 font-weight-normal">请输入用户名和密码</h1>
<label for="userName" class="sr-only"></label>
<input type="email" id="userName" class="form-control" placeholder="用户名" autocomplete="off" required autofocus>
<input type="text" id="userName" class="form-control" placeholder="用户名" autocomplete="off" required autofocus>
<label for="inputPassword" class="sr-only"></label>
<input type="password" id="inputPassword" class="form-control" placeholder="密码" required>
@@ -166,7 +169,7 @@
<div class="modal-body pw_login_group" style="display: none;height: 360px;">
<h1 class="h3 mb-3 font-weight-normal">请输入用户名和密码</h1>
<label for="userName" class="sr-only">Email address</label>
<input type="email" id="userName" class="form-control" placeholder="Email address" required autofocus>
<input type="text" id="userName" class="form-control" placeholder="Email address" required autofocus>
<label for="inputPassword" class="sr-only">Password</label>
<input type="password" id="inputPassword" class="form-control" placeholder="Password" required>