diff --git a/src/views/login/index.vue b/src/views/login/index.vue index fc9e4b94..f8dd2675 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -43,7 +43,7 @@ @@ -53,20 +53,14 @@ - - - - @@ -169,7 +163,6 @@ watchEffect(() => { const loading = ref(false); // 按钮loading const isCapslock = ref(false); // 是否大写锁定 -const passwordVisible = ref(false); // 密码是否可见 const captchaBase64 = ref(); // 验证码图片Base64字符串 const loginFormRef = ref(ElForm); // 登录表单ref @@ -217,8 +210,7 @@ const loginRules = computed(() => { * 检查输入大小写状态 */ function checkCapslock(e: any) { - const { key } = e; - isCapslock.value = key && key.length === 1 && key >= "A" && key <= "Z"; + isCapslock.value = e.getModifierState("CapsLock"); } /**