From b50a4c9177e3fa780bd8868d3ea558067ffcdcad Mon Sep 17 00:00:00 2001 From: heshunme Date: Mon, 1 Jul 2024 21:40:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86localStorage?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/authentication.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/store/authentication.js b/src/store/authentication.js index ffbf71c..e29434d 100644 --- a/src/store/authentication.js +++ b/src/store/authentication.js @@ -1,4 +1,5 @@ import axios from 'axios'; +import createPersistedState from 'vuex-persistedstate'; const state = { isAuthenticated: false, @@ -35,6 +36,12 @@ const getters = { token: (state) => state.token, }; +const plugins = [ + createPersistedState({ + storage: window.localStorage, + }), +] + export default { namespaced: true, state,