🎨 update

This commit is contained in:
2025-03-22 01:44:22 +08:00
parent 0068d36ac2
commit 86053b6bd8
30 changed files with 774 additions and 98 deletions

View File

@@ -34,7 +34,7 @@ export const useSearchStore = defineStore(
icon: image
}
]);
const searchOption = ref<string>(options[0].value);
const searchOption = ref<string[]>([options[0].value]);
const searchValue = ref<string>('');
const getIconByValue = (value: string) => {

View File

@@ -1,19 +1,51 @@
import localForage from "localforage";
export const useSystemStore = defineStore(
'system',
() => {
const isCollapsed = ref<boolean>(false);
const admin: any = reactive({
uid: '',
username: '',
nickname: '',
avatar: '',
status: '',
});
const token: any = reactive({
accessToken: '',
expireAt: '',
});
const privacyPassword = ref<string>('');
const privacyImageData = reactive<Record<string, string>>({});
const getPrivacyImage = (key: string): string | undefined => {
return privacyImageData[key];
};
// 添加密码保持相同API
const addPrivacyImage = (key: string, imageData: string) => {
privacyImageData[key] = imageData;
};
return {
isCollapsed,
admin,
token,
privacyPassword,
privacyImageData,
getPrivacyImage,
addPrivacyImage,
};
},
{
// 开启数据持久化
persistedState: {
persist: true,
storage: localStorage,
storage: localForage,
key: 'STORE-SYSTEM',
includePaths: ['isCollapsed']
}
includePaths: ['isCollapsed', 'admin', "privacyPassword", "privacyImageData"],
},
}
);

View File

@@ -112,7 +112,7 @@ export const useUploadStore = defineStore(
const image = new Image();
// 压缩图片配置
const options = reactive({
maxSizeMB: 0.4,
maxSizeMB: 0.3,
maxWidthOrHeight: 750,
maxIteration: 2,
useWebWorker: true,