login page

This commit is contained in:
landaiqing
2024-08-11 15:21:16 +08:00
parent 438965f2a2
commit ff6a4a5d09
54 changed files with 2731 additions and 170 deletions

View File

@@ -2,6 +2,7 @@ import {defineStore} from 'pinia';
import {computed, ref} from 'vue';
import {theme} from 'ant-design-vue';
import variables from '@/assets/styles/colors.module.scss';
import {parse, stringify} from "zipson/lib";
/**
* theme 配置 开启持久化
@@ -21,6 +22,7 @@ export const useThemeStore = defineStore(
return {
token: {
colorPrimary: variables[themeName.value] || '#27ba9b',
borderRadius: 10,
colorSuccess: '#1dc779',
colorWarning: '#ffb302',
colorError: '#cf4444',
@@ -39,11 +41,14 @@ export const useThemeStore = defineStore(
return {themeName, themeConfig, darkMode, darkModeComp, setThemeName, toggleDarkMode};
},
{
persistedState: {
persist: {
key: 'theme',
storage: localStorage,
includePaths: ["themeName", "darkMode"],
overwrite: true,
paths: ["themeName", "darkMode"],
serializer: {
deserialize: parse,
serialize: stringify,
},
}
}
);