🚧 add user center and account setting page

This commit is contained in:
2025-02-28 01:33:18 +08:00
parent 41fdc58c4e
commit 1c3ee31c0b
22 changed files with 288 additions and 49 deletions

View File

@@ -7,6 +7,7 @@ import {useUpscaleStore} from "@/store/modules/upscaleStore.ts";
import {useMenuStore} from "@/store/modules/menuStore.ts";
import {useUploadStore} from "@/store/modules/uploadStore.ts";
import {useImageStore} from "@/store/modules/imageStore.ts";
import {useShareStore} from "@/store/modules/shareStore.ts";
export default function useStore() {
return {
@@ -19,5 +20,6 @@ export default function useStore() {
menu: useMenuStore(),
upload: useUploadStore(),
image: useImageStore(),
share: useShareStore(),
};
}

View File

@@ -4,9 +4,12 @@ export const useMenuStore = defineStore(
const currentMenu = ref<string>('photo/all');
const userCenterMenu = ref<string>('home');
const accountSettingMenu = ref<string>('home');
return {
currentMenu,
userCenterMenu,
accountSettingMenu
};
},
{
@@ -15,7 +18,7 @@ export const useMenuStore = defineStore(
persist: true,
storage: localStorage,
key: 'menu',
includePaths: ['currentMenu', 'userCenterMenu']
includePaths: ['currentMenu', 'userCenterMenu', 'accountSettingMenu']
}
}
);

View File

@@ -0,0 +1,30 @@
export const useShareStore = defineStore(
'share',
() => {
const sharePassword = reactive<Record<string, string>>({});
// 获取密码保持相同API
const getPassword = (key: string): string | undefined => {
return sharePassword[key];
};
// 添加密码保持相同API
const addPassword = (key: string, password: string) => {
sharePassword[key] = password;
};
return {
sharePassword,
getPassword,
addPassword
};
},
{
// 开启数据持久化
persistedState: {
persist: true,
storage: localStorage,
key: 'share',
includePaths: ['sharePassword']
}
}
);