mirror of
https://github.com/Chanzhaoyu/chatgpt-web.git
synced 2025-10-22 11:54:08 +00:00
fix: store循环引用 (#1880)
This commit is contained in:
3
src/store/helper.ts
Normal file
3
src/store/helper.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
import { createPinia } from 'pinia'
|
||||||
|
|
||||||
|
export const store = createPinia()
|
@@ -1,7 +1,5 @@
|
|||||||
import type { App } from 'vue'
|
import type { App } from 'vue'
|
||||||
import { createPinia } from 'pinia'
|
import { store } from './helper'
|
||||||
|
|
||||||
export const store = createPinia()
|
|
||||||
|
|
||||||
export function setupStore(app: App) {
|
export function setupStore(app: App) {
|
||||||
app.use(store)
|
app.use(store)
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import type { AppState, Language, Theme } from './helper'
|
import type { AppState, Language, Theme } from './helper'
|
||||||
import { getLocalSetting, setLocalSetting } from './helper'
|
import { getLocalSetting, setLocalSetting } from './helper'
|
||||||
import { store } from '@/store'
|
import { store } from '@/store/helper'
|
||||||
|
|
||||||
export const useAppStore = defineStore('app-store', {
|
export const useAppStore = defineStore('app-store', {
|
||||||
state: (): AppState => getLocalSetting(),
|
state: (): AppState => getLocalSetting(),
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import { getToken, removeToken, setToken } from './helper'
|
import { getToken, removeToken, setToken } from './helper'
|
||||||
import { store } from '@/store'
|
import { store } from '@/store/helper'
|
||||||
import { fetchSession } from '@/api'
|
import { fetchSession } from '@/api'
|
||||||
|
|
||||||
interface SessionResponse {
|
interface SessionResponse {
|
||||||
|
Reference in New Issue
Block a user