From 026e4c1acd0986c9cfca977c26ebd65044b33b4e Mon Sep 17 00:00:00 2001 From: honorsuper Date: Fri, 23 Sep 2022 09:28:58 +0800 Subject: [PATCH] =?UTF-8?q?pre:=20=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/user.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index fbbedf4..dac6e1c 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -1,10 +1,8 @@ import { defineStore } from 'pinia'; -import { createStorage } from '@/utils/Storage'; import { store } from '@/store'; import { ACCESS_TOKEN, CURRENT_USER, IS_LOCKSCREEN } from '@/store/mutation-types'; import { ResultEnum } from '@/enums/httpEnum'; -const Storage = createStorage({ storage: localStorage }); import { getUserInfo, login } from '@/api/system/user'; import { storage } from '@/utils/Storage'; @@ -20,12 +18,12 @@ export interface IUserState { export const useUserStore = defineStore({ id: 'app-user', state: (): IUserState => ({ - token: Storage.get(ACCESS_TOKEN, ''), + token: storage.get(ACCESS_TOKEN, ''), username: '', welcome: '', avatar: '', permissions: [], - info: Storage.get(CURRENT_USER, {}), + info: storage.get(CURRENT_USER, {}), }), getters: { getToken(): string {