中文:收口权限与中心/立项配置改造
This commit is contained in:
@@ -63,8 +63,8 @@
|
||||
placeholder="请输入密码"
|
||||
show-password
|
||||
size="large"
|
||||
name="password"
|
||||
autocomplete="current-password"
|
||||
:name="form.rememberPassword ? 'password' : 'ctms-login-password'"
|
||||
:autocomplete="form.rememberPassword ? 'current-password' : 'new-password'"
|
||||
class="login-input"
|
||||
>
|
||||
<template #prefix>
|
||||
@@ -127,7 +127,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { reactive, ref, onMounted } from "vue";
|
||||
import { reactive, ref, onMounted, watch } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { ElMessage, type FormInstance, type FormRules } from "element-plus";
|
||||
import { useAuthStore } from "../store/auth";
|
||||
@@ -138,6 +138,7 @@ import { consumeLogoutReason, LOGOUT_REASON_TIMEOUT } from "../session/sessionMa
|
||||
const auth = useAuthStore();
|
||||
const router = useRouter();
|
||||
const REMEMBER_PASSWORD_KEY = "ctms_remember_password";
|
||||
const AGREE_PROTOCOL_KEY = "ctms_agree_protocol";
|
||||
|
||||
type PasswordCredentialConstructor = new (data: { id: string; password: string; name?: string }) => Credential;
|
||||
type StoredPasswordCredential = Credential & { id?: string; password?: string };
|
||||
@@ -213,9 +214,17 @@ onMounted(async () => {
|
||||
}
|
||||
form.email = localStorage.getItem("ctms_last_login_email") || "";
|
||||
form.rememberPassword = localStorage.getItem(REMEMBER_PASSWORD_KEY) === "true";
|
||||
form.agreeProtocol = localStorage.getItem(AGREE_PROTOCOL_KEY) === "true";
|
||||
await tryLoadBrowserCredential();
|
||||
});
|
||||
|
||||
watch(
|
||||
() => form.agreeProtocol,
|
||||
(checked) => {
|
||||
localStorage.setItem(AGREE_PROTOCOL_KEY, String(checked));
|
||||
},
|
||||
);
|
||||
|
||||
const tryLoadBrowserCredential = async () => {
|
||||
if (!form.rememberPassword || !navigator.credentials?.get) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user