From 5888ee394690659eb4e29189eebab8871e2fad9d Mon Sep 17 00:00:00 2001 From: 13218645326 Date: Sun, 10 Dec 2023 02:11:28 +0800 Subject: [PATCH] =?UTF-8?q?token=E5=86=99=E6=B4=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/main.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/store/main.ts b/src/store/main.ts index 140d129..a4d896c 100644 --- a/src/store/main.ts +++ b/src/store/main.ts @@ -2,7 +2,7 @@ export const useStore = defineStore('main', { state: () => { return { loadingFlag: false, //loading控制, - token: "eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX2tleSI6IjAxNTJmM2FjLTg5YzAtNDEyOS05YzhkLTgxM2RmMDAyYjE5MiIsInVzZXJuYW1lIjoiYWRtaW4ifQ.nbXUxyWEUJRvnBL2q0S7ROcvRCVbCnd2xn7A5nPmlYeEvGoFlM17I2e7iscDusqvSpQK5rE9ENQ8N0BWGllrYw" + token: "" } }, getters: {}, @@ -23,9 +23,9 @@ export const useStore = defineStore('main', { { // 自定义存储的 key,默认是 store.$id key: 'main', - storage: localStorage, //缓存模式 可选 localStorage sessionStorage + storage: sessionStorage, //缓存模式 可选 localStorage sessionStorage // state 中的字段名,按组打包储存 - paths: ['text', 'age'] //需要缓存的字段 与 state中相关联 + paths: ['token'] //需要缓存的字段 与 state中相关联 } ] }