2023-05-28 17:16:19 +00:00
|
|
|
import { createPinia } from 'pinia'
|
|
|
|
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
|
|
|
|
import type { App } from 'vue'
|
|
|
|
|
2023-05-29 09:18:38 +00:00
|
|
|
// 导入用户 store
|
2023-05-28 17:16:19 +00:00
|
|
|
import { useKUNGalgamerStore } from '@/store/modules/kungalgamer'
|
2023-04-20 15:34:48 +00:00
|
|
|
|
2023-05-29 09:18:38 +00:00
|
|
|
// 导入网站设置面板 store
|
|
|
|
import { useKUNGalgameSettingsStore } from '@/store/modules/settings'
|
|
|
|
|
2023-04-20 15:34:48 +00:00
|
|
|
const store = createPinia()
|
|
|
|
|
2023-05-28 17:16:19 +00:00
|
|
|
export function setupPinia(app: App<Element>) {
|
|
|
|
store.use(piniaPluginPersistedstate)
|
|
|
|
app.use(store)
|
|
|
|
}
|
|
|
|
|
|
|
|
export function storeReset() {
|
|
|
|
const userStore = useKUNGalgamerStore()
|
2023-05-29 09:18:38 +00:00
|
|
|
const settingsStore = useKUNGalgameSettingsStore()
|
|
|
|
|
2023-05-28 17:16:19 +00:00
|
|
|
userStore.$reset()
|
2023-06-14 14:51:50 +00:00
|
|
|
settingsStore.$reset()
|
2023-05-28 17:16:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export { store }
|