2024-09-02 07:40:26 +08:00
|
|
|
import { createSSRApp } from 'vue'
|
|
|
|
import App from './App.vue'
|
|
|
|
import store from './store' // 这里导入上面定义的 store
|
|
|
|
import { routeInterceptor, requestInterceptor, prototypeInterceptor } from './interceptors'
|
|
|
|
import 'virtual:uno.css'
|
|
|
|
import '@/style/index.css'
|
2024-09-05 14:05:15 +08:00
|
|
|
import { setupPinia } from './sheep/store'
|
2024-09-02 07:40:26 +08:00
|
|
|
|
|
|
|
export function createApp() {
|
|
|
|
const app = createSSRApp(App)
|
|
|
|
|
2024-09-08 14:01:29 +08:00
|
|
|
// 启动商城模块的Pinia
|
|
|
|
setupPinia(store)
|
2024-09-02 07:40:26 +08:00
|
|
|
// 使用 Pinia 存储
|
|
|
|
app.use(store)
|
|
|
|
|
|
|
|
// 其他插件
|
|
|
|
app.use(routeInterceptor)
|
|
|
|
app.use(requestInterceptor)
|
|
|
|
app.use(prototypeInterceptor)
|
|
|
|
|
|
|
|
return {
|
|
|
|
app,
|
|
|
|
}
|
|
|
|
}
|