Files
aiot-uniapp/src/store/index.ts
feige996 53f27a1917 refactor: 移除未使用的代码和功能模块
清理未使用的页面、组件、路由配置和主题相关代码
移除登录拦截和分包配置相关逻辑
简化首页和个人中心页面
2025-11-06 16:18:11 +08:00

21 lines
546 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { createPinia, setActivePinia } from 'pinia'
import { createPersistedState } from 'pinia-plugin-persistedstate' // 数据持久化
const store = createPinia()
store.use(
createPersistedState({
storage: {
getItem: uni.getStorageSync,
setItem: uni.setStorageSync,
},
}),
)
// 立即激活 Pinia 实例, 这样即使在 app.use(store)之前调用 store 也能正常工作 解决APP端白屏问题
setActivePinia(store)
export default store
// 模块统一导出
export * from './token'
export * from './user'