Copyright © 2021 - 2023 youlai.tech All Rights Reserved. 有来技术 版权所有 @@ -121,6 +122,7 @@ import LangSelect from "@/components/LangSelect/index.vue"; import SvgIcon from "@/components/SvgIcon/index.vue"; import IconEpSunny from "~icons/ep/sunny"; import IconEpMoon from "~icons/ep/moon"; +import { useSettingsStore } from "@/store/modules/settings"; // 状态管理依赖 import { useUserStore } from "@/store/modules/user"; @@ -130,6 +132,7 @@ import { useAppStore } from "@/store/modules/app"; import { LocationQuery, LocationQueryValue, useRoute } from "vue-router"; import { getCaptchaApi } from "@/api/auth"; import { LoginData } from "@/api/auth/types"; +import defaultSettings from "@/settings"; const appStore = useAppStore(); const userStore = useUserStore(); @@ -138,6 +141,14 @@ const route = useRoute(); const isDark = useDark(); const toggleDark = () => useToggle(isDark); +function handleThemeChange() { + toggleDark(); + useSettingsStore().changeSetting({ + key: "theme", + value: isDark.value ? "dark" : "light", + }); +} + /** * 按钮loading */ @@ -219,9 +230,9 @@ function checkCapslock(e: any) { */ function getCaptcha() { getCaptchaApi().then(({ data }) => { - const { verifyCodeBase64, verifyCodeKey } = data; + const { captchaImgBase64, verifyCodeKey } = data; loginData.value.verifyCodeKey = verifyCodeKey; - captchaBase64.value = verifyCodeBase64; + captchaBase64.value = captchaImgBase64; }); } @@ -306,6 +317,11 @@ onMounted(() => { background-color: transparent; box-shadow: none; + &.is-focus, + &:hover { + box-shadow: none !important; + } + input:-webkit-autofill { transition: background-color 5000s ease-in-out 0s; /* 通过延时渲染背景色变相去除背景颜色 */ }