diff --git a/main.js b/main.js index 3b7e2c7..86ce9f7 100644 --- a/main.js +++ b/main.js @@ -75,6 +75,7 @@ const storeRc = createStore({ } }) +import storeRc from './utilsRc/store/index.js' // const foldFeature = window.visualViewport && 'segments' in window.visualViewport // console.log('是否支持多段屏幕:', foldFeature) @@ -88,7 +89,7 @@ async function getDict(dictType, forceRefresh = false) { if (dictCache.has(dictType) && !forceRefresh) { return dictCache.get(dictType); } - + try { // 使用packageRc/utils/request.js中的请求方法 // 注意:这里使用的baseURL是 http://10.160.0.5:8907/ @@ -97,14 +98,14 @@ async function getDict(dictType, forceRefresh = false) { method: 'GET', load: true }); - + // 处理响应数据 if (response.code === 200 && response.data) { // 缓存数据 dictCache.set(dictType, response.data); return response.data; } - + return []; } catch (error) { console.error(`获取字典[${dictType}]失败:`, error); @@ -122,7 +123,7 @@ export function createApp() { app.component('RenderJobs', RenderJobs) app.component('RenderCompanys', RenderCompanys) // app.component('tabbar-custom', Tabbar) - + // 注册已安装的uni-ui组件 app.component('uni-icons', uniIcons) app.component('uni-popup', uniPopup) @@ -146,10 +147,10 @@ export function createApp() { app.use(Pinia.createPinia()); // 注册vuex app.use(storeRc); - + // 注册其他插件 app.use(SelectPopupPlugin); - + // Vue 3 中挂载全局属性 - 字典获取方法 app.config.globalProperties.$getDict = getDict; app.config.globalProperties.$store = storeRc; @@ -161,11 +162,11 @@ export function createApp() { ...item })); }; - + return { app, Pinia } - -} \ No newline at end of file + +}