diff --git a/src/store/helper.ts b/src/store/helper.ts new file mode 100644 index 0000000..953e453 --- /dev/null +++ b/src/store/helper.ts @@ -0,0 +1,3 @@ +import { createPinia } from 'pinia' + +export const store = createPinia() diff --git a/src/store/index.ts b/src/store/index.ts index ad01971..a10acdb 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -1,7 +1,5 @@ import type { App } from 'vue' -import { createPinia } from 'pinia' - -export const store = createPinia() +import { store } from './helper' export function setupStore(app: App) { app.use(store) diff --git a/src/store/modules/app/index.ts b/src/store/modules/app/index.ts index 055d1f8..89ec89b 100644 --- a/src/store/modules/app/index.ts +++ b/src/store/modules/app/index.ts @@ -1,7 +1,7 @@ import { defineStore } from 'pinia' import type { AppState, Language, Theme } from './helper' import { getLocalSetting, setLocalSetting } from './helper' -import { store } from '@/store' +import { store } from '@/store/helper' export const useAppStore = defineStore('app-store', { state: (): AppState => getLocalSetting(), diff --git a/src/store/modules/auth/index.ts b/src/store/modules/auth/index.ts index 8edde9c..6a4b2c7 100644 --- a/src/store/modules/auth/index.ts +++ b/src/store/modules/auth/index.ts @@ -1,6 +1,6 @@ import { defineStore } from 'pinia' import { getToken, removeToken, setToken } from './helper' -import { store } from '@/store' +import { store } from '@/store/helper' import { fetchSession } from '@/api' interface SessionResponse {