Commit 4724a241 authored by 邓晓峰's avatar 邓晓峰

fix: initMicroApp load config

parent 501b1b24
Pipeline #27175 skipped with stages
This diff was suppressed by a .gitattributes entry.
......@@ -3,7 +3,7 @@ const proxy = require('./proxy');
const slash = require('slash2');
const defaultSetting = require('./defaultSetting');
function resolve (dir) {
return join(__dirname, '../', dir)
return join(__dirname, '../', dir)
}
const { REACT_APP_ENV } = process.env;
module.exports = {
......
......@@ -12,13 +12,13 @@ export default {
},
{
name: 'civweb4',
entry: `//${window.location.hostname}:3008/civbase/civweb4`,
entry: `//${window.location.hostname}:3020/civweb4`,
container: '#micro-container',
activeRule: genActiveRule('/civbase/civweb5'),
activeRule: genActiveRule('/civbase/civweb4'),
},
{
name: 'civ_monitor',
entry: `//${window.location.hostname}:8082/civbase/civ_monitor`,
entry: `//${window.location.hostname}:8080/civbase/civ_monitor`,
container: '#micro-container',
activeRule: genActiveRule('/civbase/civ_monitor'),
},
......
/* eslint-disable */
// const proxyURL = process.env.NODE_ENV !== 'production' ? 'http://192.168.10.150:8777' : window.location.origin;
const proxyURL = 'https://panda-water.com';
const proxyURL = 'http://172.16.10.176:8080';
module.exports = {
assetsRoot: process.env.NODE_ENV !== 'production' ? proxyURL : './',
dev: {
......
......@@ -22944,9 +22944,9 @@
"dev": true
},
"kit_global_config": {
"version": "1.0.24",
"resolved": "https://g.civnet.cn:4873/kit_global_config/-/kit_global_config-1.0.24.tgz",
"integrity": "sha512-W7V7E3odjQeJTORONyNG93V834GOz3vAZxK7Of9/db0AstVtPiBWMKgptqUPibgKa7iFztqqugI9R0H3yrBCTQ==",
"version": "1.0.26",
"resolved": "https://g.civnet.cn:4873/kit_global_config/-/kit_global_config-1.0.26.tgz",
"integrity": "sha512-uLrOcaYyKHM0T2Di9iIkzkgIpGex4tFNy3c34x4WkcLL3QaivVKpqE5OZ0hU8BxOPsLDjCqTXR/CcMLNMcT4Yg==",
"requires": {
"@babel/runtime": "^7.10.5",
"js-base64": "^3.5.2",
......@@ -112,7 +112,7 @@
"immutable": "^4.0.0-rc.12",
"js-base64": "^3.5.2",
"js-cookie": "^2.2.1",
"kit_global_config": "^1.0.24",
"kit_global_config": "^1.0.26",
"kit_logger": "^1.0.2",
"kit_utils": "^1.3.11",
"lodash": "4.17.11",
......
......@@ -9,7 +9,7 @@ import {
start,
} from 'qiankun';
import micorConfig, { genActiveRule } from '../config/micor';
import { genActiveRule } from '../config/micor';
import pkg from '../package.json';
import { actionCreators } from './containers/App/store';
import { FILTER_FOLER_REG } from './utils/constants';
......@@ -33,25 +33,29 @@ const MICRO_STATUS = {
export const initMicroApps = (loader, store) => {
/* eslint-disable */
debugger
const config = createStoreage.get('globalConfig');
const application = config.products || [];
let products = [];
application && Array.isArray(application) && application.length > 0 && application.map(item => {
products.push({
name: item.PackageName,
entry: item.RouteUrl.replace(
// eslint-disable-next-line no-template-curly-in-string
'localhost:${port}',
window.location.host,
) + (item.PackageName.indexOf('civweb4') > -1 ? `/${item.PackageName}` : `/civbase/${item.PackageName}`),
container: '#micro-container',
activeRule: genActiveRule(`/civbase/${item.PackageName}`),
props: item.DefaultSetting
})
});
// console.log(products);
const entrys =
process.env.NODE_ENV !== 'production'
? micorConfig.dev
: application && Array.isArray(application) && application.length > 0
? application.map(item => {
item.name = item.PackageName;
item.entry = item.RouteUrl.replace(
// eslint-disable-next-line no-template-curly-in-string
'localhost:${port}',
window.location.host,
);
item.container = '#micro-container';
item.activeRule = genActiveRule(`/civbase/${item.PackageName}`);
item.props = JSON.parse(item.DefaultSetting);
return item;
}) || micorConfig.prod
: micorConfig.prod;
: products;
registerMicroApps(
entrys.map(item => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment