@ -6,14 +6,18 @@ interface AppDetail {
}
export const useMicroApptore = defineStore('microApp', () => {
// 从环境变量获取子应用地址
const labelAppUrl = import.meta.env.VITE_LABEL_APP_URL || '/labelapp/'
const flowAppUrl = import.meta.env.VITE_FLOW_APP_URL || '/flowapp/'
const apps = ref<Record<string, AppDetail>>({
'label-app': {
name: 'label-app',
appUrl: ''
appUrl: labelAppUrl
},
'flow-app': {
name: 'flow-app',
appUrl: flowAppUrl
})
@ -5,3 +5,14 @@ declare module '*.vue' {
const component: DefineComponent<{}, {}, any>
export default component
// 环境变量类型声明
interface ImportMetaEnv {
readonly VITE_USER_NODE_ENV: 'development' | 'production'
readonly VITE_LABEL_APP_URL: string
readonly VITE_FLOW_APP_URL: string
interface ImportMeta {
readonly env: ImportMetaEnv