From 3be088e3708c898e25ba868000b5fcaad4ab5847 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Thu, 29 Feb 2024 23:14:47 +0800 Subject: [PATCH] =?UTF-8?q?2023-11-29=20feat:=20=E6=8C=81=E4=B9=85?= =?UTF-8?q?=E5=8C=96=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/store/index.ts | 4 ++-- src/store/modules/app.ts | 3 ++- src/store/modules/lock.ts | 6 +----- src/store/modules/permission.ts | 3 ++- src/store/modules/tagsView.ts | 3 ++- 6 files changed, 10 insertions(+), 11 deletions(-) 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 = () => {