import { createSSRApp } from 'vue';
import { createPinia } from 'pinia';
import App from './App.vue';
import { useUserStore } from './store/user';

export function createApp() {
  const app = createSSRApp(App);
  const pinia = createPinia();
  
  app.use(pinia);
  
  // 初始化用户状态
  const userStore = useUserStore();
  userStore.initUser();

  return {
    app,
    pinia,
  };
}
