diff --git a/package.json b/package.json index 2b927a1c..4cc257ba 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "mitt": "^3.0.1", "nprogress": "^0.2.0", "pinia": "^2.1.7", - "pinia-plugin-persist": "^1.0.0", + "pinia-plugin-persistedstate": "^3.2.0", "qrcode": "^1.5.3", "qs": "^6.11.2", "steady-xml": "^0.1.0", diff --git a/src/store/index.ts b/src/store/index.ts index 7740bdd3..63f00452 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -1,9 +1,9 @@ import type { App } from 'vue' import { createPinia } from 'pinia' -import piniaPersist from 'pinia-plugin-persist' +import piniaPluginPersistedstate from 'pinia-plugin-persistedstate' const store = createPinia() -store.use(piniaPersist) +store.use(piniaPluginPersistedstate) export const setupStore = (app: App) => { app.use(store) diff --git a/src/store/modules/app.ts b/src/store/modules/app.ts index 1d0c797a..87336181 100644 --- a/src/store/modules/app.ts +++ b/src/store/modules/app.ts @@ -268,7 +268,8 @@ export const useAppStore = defineStore('app', { setFooter(footer: boolean) { this.footer = footer } - } + }, + persist: false }) export const useAppStoreWithOut = () => { diff --git a/src/store/modules/lock.ts b/src/store/modules/lock.ts index bf6ceb49..68ae1d7d 100644 --- a/src/store/modules/lock.ts +++ b/src/store/modules/lock.ts @@ -10,7 +10,6 @@ interface LockState { lockInfo: lockInfo } -// TODO 芋艿:【锁屏】这里有报错,后续解决下 export const useLockStore = defineStore('lock', { state: (): LockState => { return { @@ -41,10 +40,7 @@ export const useLockStore = defineStore('lock', { } } }, - persist: { - enabled: true, - strategies: [{ key: 'lock', storage: localStorage }] - } + persist: true }) export const useLockStoreWithOut = () => { diff --git a/src/store/modules/permission.ts b/src/store/modules/permission.ts index c729cea0..7406fa36 100644 --- a/src/store/modules/permission.ts +++ b/src/store/modules/permission.ts @@ -59,7 +59,8 @@ export const usePermissionStore = defineStore('permission', { setMenuTabRouters(routers: AppRouteRecordRaw[]): void { this.menuTabRouters = routers } - } + }, + persist: false }) export const usePermissionStoreWithOut = () => { diff --git a/src/store/modules/tagsView.ts b/src/store/modules/tagsView.ts index a60d0e45..25a3a1fd 100644 --- a/src/store/modules/tagsView.ts +++ b/src/store/modules/tagsView.ts @@ -132,7 +132,8 @@ export const useTagsViewStore = defineStore('tagsView', { } } } - } + }, + persist: false }) export const useTagsViewStoreWithOut = () => {