fix: 修改映射主应用配置

This commit is contained in:
江志雄 2024-03-08 16:43:51 +08:00
parent dc553222cb
commit 49bb170661
3 changed files with 19 additions and 34 deletions

View File

@ -11,17 +11,17 @@ export default defineConfig({
},
routes: [
{
name: '盒子管理',
path: '/smart-cabinet/*',
microApp: 'smart-cabinet',
name: 'intelligent-file-cabinet',
path: '/intelligent-file-cabinet/*',
microApp: 'intelligent-file-cabinet',
},
{
name: 'AI 算法仓平台',
name: 'algorithm-warehouse',
path: '/algorithm-warehouse/*',
microApp: 'algorithm-warehouse',
},
{
name: 'AI 视频分析',
name: 'smart-video-analysis',
path: '/smart-video-analysis/*',
microApp: 'smart-video-analysis',
},

View File

@ -1,24 +1,3 @@
export default {
routes: [
{
path: '/',
component: '@/layouts/index.tsx',
routes: [
{
path: '/app1',
component: '@/layouts/app-layout.tsx',
routes: [
{
path: '/project/*',
microApp: 'app1',
},
],
},
{
path: '/app2/*',
microApp: 'app2',
},
],
},
],
};
routes: [],
};

View File

@ -7,7 +7,7 @@ export async function getInitialState(): Promise<{ name: string }> {
export function useQiankunStateForSlave() {
const [globalState, setGlobalState] = useState<any>({
slogan: 'qiankun',
slogan: 'qiankun father',
});
return {
@ -19,8 +19,8 @@ export function useQiankunStateForSlave() {
export const qiankun = {
apps: [
{
name: 'smart-cabinet', // 盒子管理
entry: '//localhost:30068',
name: 'intelligent-file-cabinet', // 盒子管理
entry: '//localhost:30068/intelligent-file-cabinet/',
props: {
accountInfo: {
username: 'admin',
@ -30,15 +30,21 @@ export const qiankun = {
},
{
name: 'smart-video-analysis', // AI 智能分析仓
entry: '//localhost:30088',
entry: '//localhost:30088/smart-video-analysis/',
},
{
name: 'algorithm-warehouse', // AI 算法分析
entry: '//localhost:30078',
entry: '//localhost:30078/algorithm-warehouse/',
},
{
name: 'communal-facilities-pages', // 物料库
entry: '//localhost:30098',
entry: '//localhost:30098/communal-facilities-pages/',
},
],
lifeCycles: {
// 所有子应用在挂载完成时,打印 props 信息
async afterMount(props: any) {
console.log('主应用:', props);
},
},
};