refactor: replace Vuex with Pinia

This commit is contained in:
Aqr-K
2025-02-24 19:26:56 +08:00
parent 87239994ae
commit 721d4f7685
23 changed files with 269 additions and 222 deletions

16
src/stores/index.ts Normal file
View File

@@ -0,0 +1,16 @@
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
// 创建 Pinia 实例
const pinia = createPinia()
// 使用持久化插件
pinia.use(piniaPluginPersistedstate)
export default pinia
// 所有的 store
import { useAuthStore } from './auth'
import { useUserStore } from './user'
export { useAuthStore, useUserStore }