fix: 会话改为可吊销,退出不再踢掉其他设备
This commit is contained in:
@@ -16,6 +16,7 @@ const attempts = ref<number | null>(null);
|
||||
const username = ref("");
|
||||
const password = ref("");
|
||||
const confirmPassword = ref("");
|
||||
const currentPassword = ref("");
|
||||
const hbMode = ref("manual");
|
||||
const hbVideo = ref<number | null>(30);
|
||||
const hbDocument = ref<number | null>(120);
|
||||
@@ -124,11 +125,16 @@ async function save() {
|
||||
hours_source: hoursSource.value,
|
||||
};
|
||||
if (password.value !== "" || confirmPassword.value !== "") {
|
||||
if (!currentPassword.value) {
|
||||
errorText.value = "请填写当前管理员密码";
|
||||
return;
|
||||
}
|
||||
if (password.value !== confirmPassword.value) {
|
||||
errorText.value = "两次输入的新密码不一致";
|
||||
return;
|
||||
}
|
||||
body.admin_password = password.value;
|
||||
body.admin_password_current = currentPassword.value;
|
||||
}
|
||||
saving.value = true;
|
||||
try {
|
||||
@@ -144,6 +150,7 @@ async function save() {
|
||||
}
|
||||
password.value = "";
|
||||
confirmPassword.value = "";
|
||||
currentPassword.value = "";
|
||||
successText.value = "已保存";
|
||||
emit("saved");
|
||||
} catch {
|
||||
@@ -238,8 +245,11 @@ async function save() {
|
||||
<n-form-item label="用户名">
|
||||
<n-input v-model:value="username" autocomplete="username" />
|
||||
</n-form-item>
|
||||
<n-form-item label="新密码">
|
||||
<n-input v-model:value="password" type="password" show-password-on="click" placeholder="请输入" autocomplete="new-password" />
|
||||
<n-form-item label="当前管理员密码">
|
||||
<n-input v-model:value="currentPassword" type="password" show-password-on="click" placeholder="修改密码时填写" autocomplete="current-password" />
|
||||
</n-form-item>
|
||||
<n-form-item label="新管理员密码">
|
||||
<n-input v-model:value="password" type="password" show-password-on="click" placeholder="不修改请留空" autocomplete="new-password" />
|
||||
</n-form-item>
|
||||
<n-form-item label="再输入一次">
|
||||
<n-input v-model:value="confirmPassword" type="password" show-password-on="click" placeholder="请输入" autocomplete="new-password" />
|
||||
|
||||
Reference in New Issue
Block a user