diff --git a/.vscode/settings.json b/.vscode/settings.json index a161def..4da5073 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -19,16 +19,12 @@ "markdown" ], "cSpell.words": [ - "antfu", "axios", "bumpp", - "chatgpt", - "chenzhaoyu", "commitlint", "davinci", "dockerhub", "esno", - "GPTAPI", "highlightjs", "hljs", "iconify", @@ -39,7 +35,6 @@ "mdhljs", "mila", "nodata", - "OPENAI", "pinia", "Popconfirm", "rushstack", @@ -50,8 +45,7 @@ "Typecheck", "unplugin", "VITE", - "vueuse", - "Zhao" + "vueuse" ], "i18n-ally.enabledParsers": [ "ts" diff --git a/src/components/apps/UserInfo/index.vue b/src/components/apps/UserInfo/index.vue index fa5d9aa..dc65bda 100644 --- a/src/components/apps/UserInfo/index.vue +++ b/src/components/apps/UserInfo/index.vue @@ -4,7 +4,7 @@ import { NButton, NCard, NDivider, NForm, NFormItem, NInput, NSelect, useDialog, import { ref } from 'vue' import { useAppStore, useAuthStore, usePanelState, useUserStore } from '@/store' import { languageOptions } from '@/utils/defaultData' -import type { Language } from '@/store/modules/app/helper' +import type { Language, Theme } from '@/store/modules/app/helper' import { logout } from '@/api' import { RoundCardModal, SvgIcon } from '@/components/common/' import { updateInfo, updatePassword } from '@/api/system/user' @@ -19,10 +19,15 @@ const ms = useMessage() const dialog = useDialog() const languageValue = ref(appStore.language) +const themeValue = ref(appStore.theme) const nickName = ref(authStore.userInfo?.name || '') const isEditNickNameStatus = ref(false) const formRef = ref(null) - +const themeOptions: { label: string; key: string; value: Theme }[] = [ + { label: t('apps.userInfo.themeStyle.dark'), key: 'dark', value: 'dark' }, + { label: t('apps.userInfo.themeStyle.light'), key: 'light', value: 'light' }, + { label: t('apps.userInfo.themeStyle.auto'), key: 'Auto', value: 'auto' }, +] const updatePasswordModalState = ref({ show: false, loading: false, @@ -132,6 +137,12 @@ function handleChangeLanuage(value: Language) { appStore.setLanguage(value) location.reload() } + +function handleChangeTheme(value: Theme) { + themeValue.value = value + appStore.setTheme(value) + // location.reload() +}