🎨 update
This commit is contained in:
@@ -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) => {
|
||||
|
@@ -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"],
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@@ -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,
|
||||
|
Reference in New Issue
Block a user