AssetManager.UniApp/main.js
niannian zheng dc857a98a3 refactor(auth): 重构用户认证逻辑并迁移至Pinia存储
将微信静默登录逻辑从App.vue迁移至Pinia的user store,实现状态集中管理
全局注册api模块并优化请求重试机制,增强错误处理和日志记录
移除App.vue中的冗余代码,简化页面组件的数据获取方式
2026-02-26 13:33:57 +08:00

31 lines
551 B
JavaScript
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 App from './App'
// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
...App
})
app.$mount()
// #endif
// #ifdef VUE3
import { createSSRApp } from 'vue'
import api from './utils/api'
console.log('🚀 应用启动导入api模块')
export function createApp() {
const app = createSSRApp(App)
// 全局注册api
app.config.globalProperties.$api = api
console.log('✅ api已全局注册为 $api')
return {
app
}
}
// #endif