更新 ukey 程序

This commit is contained in:
Cheney
2024-09-19 15:25:56 +08:00
parent 9dac075967
commit fd53c6a05c
8 changed files with 161 additions and 44 deletions
+64 -13
View File
@@ -24,6 +24,7 @@
border-radius: 10px;
width: 80%;
height: 80%;
min-height: 500px;
text-align: left;
}
@@ -198,17 +199,17 @@
</div>
<div class="tab tab_pin" style="display: none">
<div class="group" style="width: 100%; ">
<input id="pwd2" style="width: 300px;height: 1.06rem" type="password" maxlength="8"
placeholder="口令,8 个数字">
<button id="login2" style="margin-right: 1rem">授&emsp;&emsp;权</button>
<button id="login_def2" style="margin-right: 1rem">默认口令</button>
</div>
<!-- <div class="group" style="width: 100%; ">-->
<!-- <input id="pwd2" style="width: 300px;height: 1.06rem" type="password" maxlength="8"-->
<!-- placeholder="口令,8 个数字">-->
<!-- <button id="login2" style="margin-right: 1rem">授&emsp;&emsp;权</button>-->
<!-- <button id="login_def2" style="margin-right: 1rem">默认口令</button>-->
<!-- </div>-->
<div class="form group">
<input id="old_pwd" style="width: 360px;height: 1.06rem" type="password" maxlength="8"
placeholder="旧口令,8 个数字">
placeholder="口令,8 个数字">
<input id="new_pwd1" style="width: 360px;height: 1.06rem" type="password" maxlength="8"
placeholder="新口令,8 个数字">
<input id="new_pwd2" style="width: 360px;height: 1.06rem" type="password" maxlength="8"
@@ -308,11 +309,22 @@
}
})
$("#login2_def").click(function () {
$("#pwd2").val("12345678");
$("#login2").click()
$("#login_def2").click(function () {
var pwd2 = "11111111"
$("#pwd2").val(pwd2);
var ukey = $("#ukeys").val();
try {
window.UKey.admin(ukey, pwd2)
success("登录成功")
} catch (e) {
alert("登录失败:" + e.message)
}
})
$("#login").click(function () {
var pwd1 = $("#pwd1").val();
check(pwd1, /\d{8}/, "口令输入错误")
@@ -495,13 +507,52 @@
$("#reset").click(function () {
alert("暂不开放")
var ukey = $("#ukeys").val();
// 重置口令
var old_pwd = $("#old_pwd").val()
try {
window.UKey.admin(ukey, old_pwd)
success("授权成功")
} catch (e) {
alert("授权失败:" + e.message)
return
}
var new_pwd1 = $("#new_pwd1").val()
var new_pwd2 = $("#new_pwd2").val()
if ( new_pwd1 !== new_pwd2 ) {
alert("新口令两次不同")
} else {
window.UKey.updatePin(3, old_pwd, new_pwd1);
alert("执行成功")
}
})
$("#update1").click(function () {
alert("暂不开放")
var old_pwd = $("#old_pwd").val()
var new_pwd1 = $("#new_pwd1").val()
var new_pwd2 = $("#new_pwd2").val()
if ( new_pwd1 !== new_pwd2 ) {
alert("新口令两次不同")
} else {
window.UKey.updatePin(1, old_pwd, new_pwd1);
alert("执行成功")
}
})
$("#update2").click(function () {
alert("暂不开放")
var old_pwd = $("#old_pwd").val()
var new_pwd1 = $("#new_pwd1").val()
var new_pwd2 = $("#new_pwd2").val()
if ( new_pwd1 !== new_pwd2 ) {
alert("新口令两次不同")
} else {
window.UKey.updatePin(2, old_pwd, new_pwd1);
alert("执行成功")
}
})
})