chore: update vite 8

This commit is contained in:
xingyu4j
2026-03-13 15:51:28 +08:00
parent 0e4bf80bf4
commit 443e4b04cd
12 changed files with 867 additions and 257 deletions

View File

@@ -7,6 +7,28 @@ import SecureLS from 'secure-ls';
let pinia: Pinia;
type SecureLSStorage = {
get(key: string): any;
set(key: string, value: unknown): void;
};
type SecureLSCtor = new (config?: {
encodingType?: string;
encryptionSecret?: string;
isCompression?: boolean;
metaKey?: string;
}) => SecureLSStorage;
const secureLSModule = SecureLS as unknown as {
SecureLS?: SecureLSCtor;
default?: SecureLSCtor;
};
const SecureLSConstructor =
secureLSModule.default ??
secureLSModule.SecureLS ??
(SecureLS as unknown as SecureLSCtor);
export interface InitStoreOptions {
/**
* @zh_CN 应用名,由于 @vben/stores 是公用的后续可能有多个app为了防止多个app缓存冲突可在这里配置应用名,应用名将被用于持久化的前缀
@@ -21,7 +43,7 @@ export async function initStores(app: App, options: InitStoreOptions) {
const { createPersistedState } = await import('pinia-plugin-persistedstate');
pinia = createPinia();
const { namespace } = options;
const ls = new SecureLS({
const ls = new SecureLSConstructor({
encodingType: 'aes',
encryptionSecret: import.meta.env.VITE_APP_STORE_SECURE_KEY,
isCompression: true,