Commit fc4d4942 authored by 邓晓峰's avatar 邓晓峰

fix: load micro config

parent af263493
This diff was suppressed by a .gitattributes entry.
......@@ -5,10 +5,16 @@ export default {
dev: [
{
name: 'civ_monitor',
entry: `//${window.location.hostname}:8082/civ_monitor`,
entry: `//${window.location.hostname}:8081/civ_monitor`,
container: '#micro-container',
activeRule: genActiveRule('/civbase/civ_monitor'),
},
{
name: 'civ_water',
entry: `//${window.location.hostname}:8083/civ_water`,
container: '#micro-container',
activeRule: genActiveRule('/civbase/civ_water'),
},
{
name: 'civweb4',
entry: `//${window.location.hostname}:3020/civweb4`,
......
/* eslint-disable */
// const proxyURL = process.env.NODE_ENV !== 'production' ? 'http://192.168.10.150:8777' : window.location.origin;
const proxyURL = 'http://172.16.10.183:8087';
const proxyURL = 'http://192.168.19.105:8530';
module.exports = {
assetsRoot: process.env.NODE_ENV !== 'production' ? proxyURL : './',
dev: {
......
......@@ -23089,9 +23089,9 @@
"dev": true
},
"kit_global_config": {
"version": "1.0.26",
"resolved": "https://g.civnet.cn:4873/kit_global_config/-/kit_global_config-1.0.26.tgz",
"integrity": "sha512-uLrOcaYyKHM0T2Di9iIkzkgIpGex4tFNy3c34x4WkcLL3QaivVKpqE5OZ0hU8BxOPsLDjCqTXR/CcMLNMcT4Yg==",
"version": "1.0.28",
"resolved": "https://g.civnet.cn:4873/kit_global_config/-/kit_global_config-1.0.28.tgz",
"integrity": "sha512-S9I6UYZxH2KY/cS85j5WW3bk+NqKREDaIZRdP4q6xGr4m0bTFPCckzHmUnccDbErbBJJrKx8+HI4ABCmzZ8dlw==",
"requires": {
"@babel/runtime": "^7.10.5",
"js-base64": "^3.5.2",
{
"name": "civbase",
"version": "0.0.14",
"description": "",
"repository": {
"type": "git",
"url": "https://g.civnet.cn:8443/test/maintenance.git"
},
"engines": {
"npm": ">=5",
"node": ">=8.15.1"
},
"author": "dengxiaofeng",
"license": "MIT",
"scripts": {
"init": "npm install --registry=https://g.civnet.cn:4873",
"analyze:clean": "rimraf stats.json",
"preanalyze": "npm run analyze:clean",
"analyze": "cross-env ANALYZE=1 npm run build",
"npmcheckversion": "node ./internals/scripts/npmcheckversion.js",
"preinstall": "npm run npmcheckversion",
"build": "cross-env NODE_ENV=production node internals/webpack/build.js",
"build:clean": "rimraf ./build",
"openapi": "cross-env NODE_ENV=development node server/openapi/run.js",
"start": "cross-env REACT_APP_ENV=dev NODE_ENV=development node server --port=$port",
"start:tunnel": "cross-env NODE_ENV=development ENABLE_TUNNEL=true node server",
"start:production": "npm run test && npm run build && npm run start:prod",
"start:prod": "cross-env NODE_ENV=production node server",
"release": "np --no-cleanup --yolo --no-publish",
"cm": "git-cz",
"log": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md",
"update:deps": "yarn upgrade-interactive --latest",
"presetup": "npm i chalk shelljs",
"setup": "node ./internals/scripts/setup.js",
"clean": "shjs ./internals/scripts/clean.js",
"clean:all": "npm run analyze:clean && npm run test:clean && npm run build:clean",
"generate": "plop --plopfile internals/generators/index.js",
"lint": "npm run lint:js && npm run lint:prettier",
"lint:style": "stylelint --fix \"src/**/*.less\" --syntax less",
"lint:eslint": "eslint --ignore-path .gitignore --ignore-pattern internals/scripts",
"lint:eslint:fix": "eslint --ignore-path .gitignore --ignore-pattern internals/scripts --fix",
"lint:fix": "eslint --fix --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src",
"lint:js": "eslint --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src ",
"lint:prettier": "prettier -c ./src/**/*.js",
"lint:staged": "lint-staged",
"pretest": "npm run test:clean && npm run lint",
"prettier": "prettier --write ./src/**/*.js",
"test:clean": "rimraf ./coverage",
"test": "cross-env NODE_ENV=test jest --coverage",
"test:watch": "cross-env NODE_ENV=test jest --watchAll",
"coveralls": "cat ./coverage/lcov.info | coveralls",
"prettify": "prettier --write"
},
"browserslist": [
"last 2 versions",
"> 1%",
"IE 10"
],
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"lint-staged": {
"*.js": [
"npm run lint:eslint:fix",
"git add --force"
"name": "civbase",
"version": "0.0.14",
"description": "",
"repository": {
"type": "git",
"url": "https://g.civnet.cn:8443/test/maintenance.git"
},
"engines": {
"npm": ">=5",
"node": ">=8.15.1"
},
"author": "dengxiaofeng",
"license": "MIT",
"scripts": {
"init": "npm install --registry=https://g.civnet.cn:4873",
"analyze:clean": "rimraf stats.json",
"preanalyze": "npm run analyze:clean",
"analyze": "cross-env ANALYZE=1 npm run build",
"npmcheckversion": "node ./internals/scripts/npmcheckversion.js",
"preinstall": "npm run npmcheckversion",
"build": "cross-env NODE_ENV=production node internals/webpack/build.js",
"build:clean": "rimraf ./build",
"openapi": "cross-env NODE_ENV=development node server/openapi/run.js",
"start": "cross-env REACT_APP_ENV=dev NODE_ENV=development node server --port=$port",
"start:tunnel": "cross-env NODE_ENV=development ENABLE_TUNNEL=true node server",
"start:production": "npm run test && npm run build && npm run start:prod",
"start:prod": "cross-env NODE_ENV=production node server",
"release": "np --no-cleanup --yolo --no-publish",
"cm": "git-cz",
"log": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md",
"update:deps": "yarn upgrade-interactive --latest",
"presetup": "npm i chalk shelljs",
"setup": "node ./internals/scripts/setup.js",
"clean": "shjs ./internals/scripts/clean.js",
"clean:all": "npm run analyze:clean && npm run test:clean && npm run build:clean",
"generate": "plop --plopfile internals/generators/index.js",
"lint": "npm run lint:js && npm run lint:prettier",
"lint:style": "stylelint --fix \"src/**/*.less\" --syntax less",
"lint:eslint": "eslint --ignore-path .gitignore --ignore-pattern internals/scripts",
"lint:eslint:fix": "eslint --ignore-path .gitignore --ignore-pattern internals/scripts --fix",
"lint:fix": "eslint --fix --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src",
"lint:js": "eslint --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src ",
"lint:prettier": "prettier -c ./src/**/*.js",
"lint:staged": "lint-staged",
"pretest": "npm run test:clean && npm run lint",
"prettier": "prettier --write ./src/**/*.js",
"test:clean": "rimraf ./coverage",
"test": "cross-env NODE_ENV=test jest --coverage",
"test:watch": "cross-env NODE_ENV=test jest --watchAll",
"coveralls": "cat ./coverage/lcov.info | coveralls",
"prettify": "prettier --write"
},
"browserslist": [
"last 2 versions",
"> 1%",
"IE 10"
],
"*.json": [
"prettier --write",
"git add --force"
]
},
"pre-commit": "lint:staged",
"mock": true,
"checkFiles": [
"src/**/*.js*",
"src/**/*.ts*",
"src/**/*.less",
"config/**/*.js*",
"scripts/**/*.js"
],
"resolutions": {
"babel-core": "7.0.0-bridge.0"
},
"dependencies": {
"@ant-design/colors": "^5.0.1",
"@ant-design/icons": "^4.0.0",
"@ant-design/pro-layout": "^6.14.0",
"@ant-design/pro-skeleton": "^1.0.0-beta.2",
"@ant-design/pro-table": "^2.5.3",
"@ant-design/pro-utils": "^1.10.4",
"@babel/polyfill": "7.4.3",
"@babel/runtime": "^7.10.5",
"@wisdom-utils/components": "0.0.14",
"@wisdom-utils/runtime": "0.0.15",
"@wisdom-utils/utils": "0.0.46",
"animate.css": "^4.1.1",
"antd": "^4.11.2",
"compression": "1.7.4",
"connected-react-router": "6.4.0",
"fontfaceobserver": "2.1.0",
"history": "4.9.0",
"hoist-non-react-statics": "3.3.0",
"immer": "3.0.0",
"immutable": "^4.0.0-rc.12",
"js-base64": "^3.5.2",
"js-cookie": "^2.2.1",
"kit_global_config": "^1.0.26",
"kit_logger": "^1.0.2",
"kit_utils": "^1.3.11",
"lodash": "4.17.11",
"minimist": "1.2.0",
"mqtt-client": "^1.0.11",
"omit.js": "^2.0.2",
"pinyin-match": "^1.1.1",
"promise.prototype.finally": "^3.1.2",
"prop-types": "15.7.2",
"qiankun": "^2.4.8",
"qrcode.react": "^1.0.0",
"react": "16.12.0",
"react-dom": "16.12.0",
"react-draggable": "^4.4.3",
"react-helmet": "6.0.0-beta",
"react-helmet-async": "^1.0.4",
"react-intl": "^3.12.1",
"react-redux": "7.0.2",
"react-router-config": "^5.1.1",
"react-router-dom": "5.1.0",
"react-use": "^15.3.4",
"redux": "4.0.1",
"redux-immutable": "^4.0.0",
"redux-saga": "1.0.2",
"redux-thunk": "^2.3.0",
"reselect": "4.0.0",
"sanitize.css": "8.0.0",
"sha1": "^1.1.1",
"styled-components": "4.2.0",
"use-merge-value": "^1.0.2"
},
"devDependencies": {
"@babel/cli": "7.4.3",
"@babel/core": "7.4.3",
"@babel/plugin-proposal-class-properties": "7.4.0",
"@babel/plugin-syntax-dynamic-import": "7.2.0",
"@babel/plugin-transform-flow-strip-types": "^7.12.13",
"@babel/plugin-transform-modules-commonjs": "7.4.3",
"@babel/plugin-transform-react-constant-elements": "7.2.0",
"@babel/plugin-transform-react-inline-elements": "7.2.0",
"@babel/plugin-transform-react-jsx": "^7.12.16",
"@babel/preset-env": "7.4.3",
"@babel/preset-react": "7.0.0",
"@babel/register": "7.4.0",
"@commitlint/cli": "^9.1.2",
"@commitlint/config-conventional": "^9.1.2",
"@pmmmwh/react-refresh-webpack-plugin": "^0.4.3",
"@svgr/webpack": "4.3.3",
"@umijs/bundler-utils": "3.3.7",
"@umijs/deps": "^0.8.1",
"@umijs/fabric": "^2.2.0",
"@umijs/runtime": "3.3.7",
"@umijs/utils": "3.3.7",
"add-asset-html-webpack-plugin": "3.1.3",
"antd-icon-reduce-loader": "^1.0.6",
"antd-icon-reduce-plugin": "^1.1.1",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "10.0.1",
"babel-loader": "8.0.5",
"babel-plugin-dynamic-import-node": "2.2.0",
"babel-plugin-import": "^1.13.0",
"babel-plugin-lodash": "3.3.4",
"babel-plugin-react-intl": "3.0.1",
"babel-plugin-styled-components": "1.10.0",
"babel-plugin-transform-react-remove-prop-types": "0.4.24",
"bcore": "^0.0.22",
"body-parser": "^1.19.0",
"chalk": "2.4.2",
"child_process": "^1.0.2",
"circular-dependency-plugin": "5.0.2",
"classnames": "^2.2.6",
"cliui": "^7.0.4",
"compare-versions": "3.4.0",
"compression-webpack-plugin": "2.0.0",
"conventional-changelog-cli": "^2.1.0",
"copy-webpack-plugin": "^5.0.4",
"core-js": "^3.6.5",
"coveralls": "3.0.3",
"cross-env": "^5.2.1",
"css-loader": "^4.2.1",
"cz-customizable": "^6.3.0",
"dotenv": "^8.2.0",
"dumi": "^1.0.13",
"ejs": "^3.1.6",
"eslint": "^5.16.0",
"eslint-config-airbnb": "17.1.0",
"eslint-config-airbnb-base": "13.1.0",
"eslint-config-prettier": "4.1.0",
"eslint-import-resolver-webpack": "0.11.1",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-jsx-a11y": "6.2.1",
"eslint-plugin-prettier": "3.0.1",
"eslint-plugin-react": "7.12.4",
"eslint-plugin-react-hooks": "1.6.0",
"eslint-plugin-redux-saga": "1.0.0",
"express": "^4.17.1",
"file-loader": "3.0.1",
"fs": "0.0.1-security",
"fs-extra": "^9.0.1",
"html-loader": "0.5.5",
"html-webpack-plugin": "4.4.0",
"http-proxy-middleware": "^1.0.5",
"husky": "^2.3.0",
"imports-loader": "0.8.0",
"invariant": "2.2.4",
"ip": "1.1.5",
"jest-cli": "24.7.1",
"jest-dom": "3.1.3",
"jest-styled-components": "6.3.1",
"jsonp": "^0.2.1",
"less": "3.12.0",
"less-loader": "5.0.0",
"lint-staged": "8.1.5",
"mini-css-extract-plugin": "^0.12.0",
"mockjs": "^1.0.1-beta3",
"moment": "^2.29.1",
"mousetrap": "^1.6.5",
"multer": "^1.4.2",
"nanoid": "^3.1.16",
"node-fetch": "^2.6.1",
"node-plop": "0.18.0",
"np": "^7.0.0",
"null-loader": "0.1.1",
"nunjucks": "^3.2.2",
"optimize-css-assets-webpack-plugin": "5.0.4",
"ora": "^5.1.0",
"path-to-regexp": "^2.4.0",
"plop": "2.3.0",
"postcss": "7.0.32",
"postcss-flexbugs-fixes": "4.2.1",
"postcss-loader": "3.0.0",
"postcss-preset-env": "6.7.0",
"postcss-safe-parser": "^4.0.2",
"pre-commit": "1.2.2",
"prettier": "1.17.0",
"raw-loader": "^4.0.2",
"react-app-polyfill": "0.2.2",
"react-error-overlay": "6.0.8",
"react-refresh": "^0.9.0",
"react-sticky": "^6.0.3",
"react-test-renderer": "16.8.6",
"react-testing-library": "6.1.2",
"redux-logger": "^3.0.6",
"regenerator-runtime": "^0.13.7",
"reserved-words": "^0.1.2",
"rimraf": "2.6.3",
"shelljs": "0.8.3",
"slash2": "^2.0.0",
"speed-measure-webpack-plugin": "1.3.3",
"spinner": "^0.3.4",
"stats-webpack-plugin": "0.7.0",
"style-loader": "^1.2.1",
"stylelint": "10.0.1",
"stylelint-config-recommended": "2.2.0",
"stylelint-config-styled-components": "0.1.1",
"stylelint-processor-styled-components": "1.6.0",
"svg-url-loader": "^2.3.2",
"swagger-ui-react": "^3.42.0",
"swagger2openapi": "^7.0.5",
"terser-webpack-plugin": "1.2.3",
"traverse": "^0.6.6",
"umi-webpack-bundle-analyzer": "3.6.0",
"url-loader": "1.1.2",
"webpack": "4.44.1",
"webpack-chain": "6.5.1",
"webpack-cli": "3.3.0",
"webpack-dev-middleware": "3.6.2",
"webpack-hot-middleware": "2.24.3",
"webpack-manifest-plugin": "^3.0.0",
"webpack-pwa-manifest": "4.0.0",
"webpack-theme-color-replacer": "^1.3.15",
"webpackbar": "5.0.0-3",
"whatwg-fetch": "3.0.0",
"yorkie": "^2.0.0",
"zlib": "^1.0.5"
}
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"lint-staged": {
"*.js": [
"npm run lint:eslint:fix",
"git add --force"
],
"*.json": [
"prettier --write",
"git add --force"
]
},
"pre-commit": "lint:staged",
"mock": true,
"checkFiles": [
"src/**/*.js*",
"src/**/*.ts*",
"src/**/*.less",
"config/**/*.js*",
"scripts/**/*.js"
],
"resolutions": {
"babel-core": "7.0.0-bridge.0"
},
"dependencies": {
"@ant-design/colors": "^5.0.1",
"@ant-design/icons": "^4.0.0",
"@ant-design/pro-layout": "^6.14.0",
"@ant-design/pro-skeleton": "^1.0.0-beta.2",
"@ant-design/pro-table": "^2.5.3",
"@ant-design/pro-utils": "^1.10.4",
"@babel/polyfill": "7.4.3",
"@babel/runtime": "^7.10.5",
"@wisdom-utils/components": "0.0.14",
"@wisdom-utils/runtime": "0.0.15",
"@wisdom-utils/utils": "0.0.46",
"animate.css": "^4.1.1",
"antd": "^4.11.2",
"compression": "1.7.4",
"connected-react-router": "6.4.0",
"fontfaceobserver": "2.1.0",
"history": "4.9.0",
"hoist-non-react-statics": "3.3.0",
"immer": "3.0.0",
"immutable": "^4.0.0-rc.12",
"js-base64": "^3.5.2",
"js-cookie": "^2.2.1",
"kit_global_config": "^1.0.28",
"kit_logger": "^1.0.2",
"kit_utils": "^1.3.11",
"lodash": "4.17.11",
"minimist": "1.2.0",
"mqtt-client": "^1.0.11",
"omit.js": "^2.0.2",
"pinyin-match": "^1.1.1",
"promise.prototype.finally": "^3.1.2",
"prop-types": "15.7.2",
"qiankun": "^2.4.8",
"qrcode.react": "^1.0.0",
"react": "16.12.0",
"react-dom": "16.12.0",
"react-draggable": "^4.4.3",
"react-helmet": "6.0.0-beta",
"react-helmet-async": "^1.0.4",
"react-intl": "^3.12.1",
"react-redux": "7.0.2",
"react-router-config": "^5.1.1",
"react-router-dom": "5.1.0",
"react-use": "^15.3.4",
"redux": "4.0.1",
"redux-immutable": "^4.0.0",
"redux-saga": "1.0.2",
"redux-thunk": "^2.3.0",
"reselect": "4.0.0",
"sanitize.css": "8.0.0",
"sha1": "^1.1.1",
"styled-components": "4.2.0",
"use-merge-value": "^1.0.2"
},
"devDependencies": {
"@babel/cli": "7.4.3",
"@babel/core": "7.4.3",
"@babel/plugin-proposal-class-properties": "7.4.0",
"@babel/plugin-syntax-dynamic-import": "7.2.0",
"@babel/plugin-transform-flow-strip-types": "^7.12.13",
"@babel/plugin-transform-modules-commonjs": "7.4.3",
"@babel/plugin-transform-react-constant-elements": "7.2.0",
"@babel/plugin-transform-react-inline-elements": "7.2.0",
"@babel/plugin-transform-react-jsx": "^7.12.16",
"@babel/preset-env": "7.4.3",
"@babel/preset-react": "7.0.0",
"@babel/register": "7.4.0",
"@commitlint/cli": "^9.1.2",
"@commitlint/config-conventional": "^9.1.2",
"@pmmmwh/react-refresh-webpack-plugin": "^0.4.3",
"@svgr/webpack": "4.3.3",
"@umijs/bundler-utils": "3.3.7",
"@umijs/deps": "^0.8.1",
"@umijs/fabric": "^2.2.0",
"@umijs/runtime": "3.3.7",
"@umijs/utils": "3.3.7",
"add-asset-html-webpack-plugin": "3.1.3",
"antd-icon-reduce-loader": "^1.0.6",
"antd-icon-reduce-plugin": "^1.1.1",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "10.0.1",
"babel-loader": "8.0.5",
"babel-plugin-dynamic-import-node": "2.2.0",
"babel-plugin-import": "^1.13.0",
"babel-plugin-lodash": "3.3.4",
"babel-plugin-react-intl": "3.0.1",
"babel-plugin-styled-components": "1.10.0",
"babel-plugin-transform-react-remove-prop-types": "0.4.24",
"bcore": "^0.0.22",
"body-parser": "^1.19.0",
"chalk": "2.4.2",
"child_process": "^1.0.2",
"circular-dependency-plugin": "5.0.2",
"classnames": "^2.2.6",
"cliui": "^7.0.4",
"compare-versions": "3.4.0",
"compression-webpack-plugin": "2.0.0",
"conventional-changelog-cli": "^2.1.0",
"copy-webpack-plugin": "^5.0.4",
"core-js": "^3.6.5",
"coveralls": "3.0.3",
"cross-env": "^5.2.1",
"css-loader": "^4.2.1",
"cz-customizable": "^6.3.0",
"dotenv": "^8.2.0",
"dumi": "^1.0.13",
"ejs": "^3.1.6",
"eslint": "^5.16.0",
"eslint-config-airbnb": "17.1.0",
"eslint-config-airbnb-base": "13.1.0",
"eslint-config-prettier": "4.1.0",
"eslint-import-resolver-webpack": "0.11.1",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-jsx-a11y": "6.2.1",
"eslint-plugin-prettier": "3.0.1",
"eslint-plugin-react": "7.12.4",
"eslint-plugin-react-hooks": "1.6.0",
"eslint-plugin-redux-saga": "1.0.0",
"express": "^4.17.1",
"file-loader": "3.0.1",
"fs": "0.0.1-security",
"fs-extra": "^9.0.1",
"html-loader": "0.5.5",
"html-webpack-plugin": "4.4.0",
"http-proxy-middleware": "^1.0.5",
"husky": "^2.3.0",
"imports-loader": "0.8.0",
"invariant": "2.2.4",
"ip": "1.1.5",
"jest-cli": "24.7.1",
"jest-dom": "3.1.3",
"jest-styled-components": "6.3.1",
"jsonp": "^0.2.1",
"less": "3.12.0",
"less-loader": "5.0.0",
"lint-staged": "8.1.5",
"mini-css-extract-plugin": "^0.12.0",
"mockjs": "^1.0.1-beta3",
"moment": "^2.29.1",
"mousetrap": "^1.6.5",
"multer": "^1.4.2",
"nanoid": "^3.1.16",
"node-fetch": "^2.6.1",
"node-plop": "0.18.0",
"np": "^7.0.0",
"null-loader": "0.1.1",
"nunjucks": "^3.2.2",
"optimize-css-assets-webpack-plugin": "5.0.4",
"ora": "^5.1.0",
"path-to-regexp": "^2.4.0",
"plop": "2.3.0",
"postcss": "7.0.32",
"postcss-flexbugs-fixes": "4.2.1",
"postcss-loader": "3.0.0",
"postcss-preset-env": "6.7.0",
"postcss-safe-parser": "^4.0.2",
"pre-commit": "1.2.2",
"prettier": "1.17.0",
"raw-loader": "^4.0.2",
"react-app-polyfill": "0.2.2",
"react-error-overlay": "6.0.8",
"react-refresh": "^0.9.0",
"react-sticky": "^6.0.3",
"react-test-renderer": "16.8.6",
"react-testing-library": "6.1.2",
"redux-logger": "^3.0.6",
"regenerator-runtime": "^0.13.7",
"reserved-words": "^0.1.2",
"rimraf": "2.6.3",
"shelljs": "0.8.3",
"slash2": "^2.0.0",
"speed-measure-webpack-plugin": "1.3.3",
"spinner": "^0.3.4",
"stats-webpack-plugin": "0.7.0",
"style-loader": "^1.2.1",
"stylelint": "10.0.1",
"stylelint-config-recommended": "2.2.0",
"stylelint-config-styled-components": "0.1.1",
"stylelint-processor-styled-components": "1.6.0",
"svg-url-loader": "^2.3.2",
"swagger-ui-react": "^3.42.0",
"swagger2openapi": "^7.0.5",
"terser-webpack-plugin": "1.2.3",
"traverse": "^0.6.6",
"umi-webpack-bundle-analyzer": "3.6.0",
"url-loader": "1.1.2",
"webpack": "4.44.1",
"webpack-chain": "6.5.1",
"webpack-cli": "3.3.0",
"webpack-dev-middleware": "3.6.2",
"webpack-hot-middleware": "2.24.3",
"webpack-manifest-plugin": "^3.0.0",
"webpack-pwa-manifest": "4.0.0",
"webpack-theme-color-replacer": "^1.3.15",
"webpackbar": "5.0.0-3",
"whatwg-fetch": "3.0.0",
"yorkie": "^2.0.0",
"zlib": "^1.0.5"
}
}
import 'kit_logger';
import {
addGlobalUncaughtErrorHandler,
initGlobalState,
registerMicroApps,
runAfterFirstMounted,
setDefaultMountApp,
start,
addGlobalUncaughtErrorHandler,
initGlobalState,
registerMicroApps,
runAfterFirstMounted,
setDefaultMountApp,
start,
} from 'qiankun';
import micorConfig, { genActiveRule } from '../config/micor';
......@@ -17,171 +17,171 @@ import { FILTER_FOLER_REG } from './utils/constants';
// eslint-disable-next-line no-undef
const Logger = logger('micro');
const MICRO_STATUS = {
NOT_LOADED: 'NOT_LOADED',
LOADING_SOURCE_CODE: 'LOADING_SOURCE_CODE',
NOT_BOOTSTRAPPED: 'NOT_BOOTSTRAPPED',
BOOTSTRAPPING: 'BOOTSTRAPPING',
NOT_MOUNTED: 'NOT_MOUNTED',
MOUNTING: 'MOUNTING',
MOUNTED: 'MOUNTED',
UPDATING: 'UPDATING',
UNMOUNTING: 'UNMOUNTING',
UNLOADING: 'UNLOADING',
SKIP_BECAUSE_BROKEN: 'SKIP_BECAUSE_BROKEN',
LOAD_ERROR: 'LOAD_ERROR',
NOT_LOADED: 'NOT_LOADED',
LOADING_SOURCE_CODE: 'LOADING_SOURCE_CODE',
NOT_BOOTSTRAPPED: 'NOT_BOOTSTRAPPED',
BOOTSTRAPPING: 'BOOTSTRAPPING',
NOT_MOUNTED: 'NOT_MOUNTED',
MOUNTING: 'MOUNTING',
MOUNTED: 'MOUNTED',
UPDATING: 'UPDATING',
UNMOUNTING: 'UNMOUNTING',
UNLOADING: 'UNLOADING',
SKIP_BECAUSE_BROKEN: 'SKIP_BECAUSE_BROKEN',
LOAD_ERROR: 'LOAD_ERROR',
};
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
})
});
/* eslint-disable */
// console.log(products);
const entrys =
process.env.NODE_ENV !== 'production'
? micorConfig.dev
: products;
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: "//" + window.location.host + (`/${item.PackageName}`),
// item.RouteUrl.replace(
// // eslint-disable-next-line no-template-curly-in-string
// 'localhost:${port}',
// window.location.host,
// ) + (item.PackageName.indexOf('civweb4') > -1 ? `/${item.PackageName}` : `/${item.PackageName}`),
container: '#micro-container',
activeRule: genActiveRule(`/civbase/${item.PackageName}`),
props: item.DefaultSetting
})
});
registerMicroApps(
entrys.map(item => {
item.loader = loader;
item.props = {
emitter: window.share.event,
baseRoot: item.name,
// eslint-
// disable-next-line no-undef
globalConfig: createStoreage.get('globalConfig'),
XMLHttpRequest: window.XMLHttpRequest,
};
return item;
}),
{
beforeLoad: [
app => {
store.dispatch(actionCreators.updateMicroMounted(true));
Logger.info('[LifeCycle] before load %c%s');
},
],
beforeMount: [
app => {
Logger.info(`[LifeCycle] before mount %c%s ${app.name}`);
},
],
afterMount: [
app => {
store.dispatch(actionCreators.updateMicroMounted(false));
Logger.info(`[LifeCycle] after mount %c%s ${app.name}`);
console.log("products", products);
const entrys =
process.env.NODE_ENV !== 'production' ?
micorConfig.dev :
products;
registerMicroApps(
entrys.map(item => {
item.loader = loader;
item.props = {
emitter: window.share.event,
baseRoot: item.name,
// eslint-
// disable-next-line no-undef
globalConfig: createStoreage.get('globalConfig'),
XMLHttpRequest: window.XMLHttpRequest,
};
return item;
}), {
beforeLoad: [
app => {
store.dispatch(actionCreators.updateMicroMounted(true));
Logger.info('[LifeCycle] before load %c%s');
},
],
beforeMount: [
app => {
Logger.info(`[LifeCycle] before mount %c%s ${app.name}`);
},
],
afterMount: [
app => {
store.dispatch(actionCreators.updateMicroMounted(false));
Logger.info(`[LifeCycle] after mount %c%s ${app.name}`);
},
],
beforeUnmount: [
app => {
window.share.event.removeAllListeners('changeRoute');
Logger.info(`[LifeCycle] after unmount %c%s ${app.name}`);
},
],
afterUnmount: [app => {}],
},
],
beforeUnmount: [
app => {
window.share.event.removeAllListeners('changeRoute');
Logger.info(`[LifeCycle] after unmount %c%s ${app.name}`);
);
const globalStore = store.getState().toJS();
const { setGlobalState } = initGlobalState({
// eslint-disable-next-line no-undef
globalConfig: createStoreage.get('globalConfig'),
global: globalStore.global
});
setGlobalState({
// eslint-disable-next-line no-undef
globalConfig: createStoreage.get('globalConfig'),
});
start({
sandbox: {
experimentalStyleIsolation: true,
loose: true,
},
],
afterUnmount: [app => {}],
},
);
const globalStore = store.getState().toJS();
const { setGlobalState } = initGlobalState({
// eslint-disable-next-line no-undef
globalConfig: createStoreage.get('globalConfig'),
global: globalStore.global
});
setGlobalState({
// eslint-disable-next-line no-undef
globalConfig: createStoreage.get('globalConfig'),
});
start({
sandbox: {
experimentalStyleIsolation: true,
loose: true,
},
singular: true,
scopedCSS: true,
// prefetch: 'all',
// eslint-disable-next-line no-underscore-dangle
// getPublicPath: window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__,
excludeAssetFilter: url =>
url.indexOf('framework/amap/AMap.UI') !== -1 ||
url.indexOf('framework/amap/init.js') !== -1 ||
url.indexOf('configuration/js') !== -1 ||
url.indexOf('framework/three.js') !== -1 ||
url.indexOf('threedimensional/frameworkthree') !== -1 ||
url.indexOf('iframe/Civ3DLLab/js') !== -1 ||
url.indexOf('framework/jquery/gridify-min.js') !== -1 ||
url.indexOf('framework/jquery/gridify.qrcode.js') !== -1 ||
url.indexOf('echarts') !== -1 ||
url.indexOf('lbs.amap.com') !== -1 ||
url.indexOf('restapi.amap.com') !== -1 ||
url.indexOf('webapi.amap.com') !== -1 ||
url.indexOf('webapi.amap.com/count') !== -1 ||
url.indexOf('api.map.baidu.com') !== -1 ||
url.indexOf('map.baidu.com') !== -1 ||
url.indexOf('pv.sohu.com') !== -1 ||
url.indexOf('mt0.google.cn') !== -1 ||
url.indexOf('mt1.google.cn') !== -1 ||
url.indexOf('mt2.google.cn') !== -1 ||
url.indexOf('mt3.google.cn') !== -1 ||
url.indexOf('hm.baidu.com') !== -1 ||
url.indexOf('https://maponline0.bdimg.com') !== -1 ||
url.indexOf('https://maponline1.bdimg.com') !== -1 ||
url.indexOf('https://maponline2.bdimg.com') !== -1 ||
url.indexOf('https://maponline3.bdimg.com') !== -1 ||
url.indexOf('https://api.map.baidu.com/getscript') !== -1,
});
runAfterFirstMounted(() => {
Logger.info('[MainApp] first app mounted');
});
// eslint-disable-next-line no-use-before-define
defaultApp();
addGlobalUncaughtErrorHandler(event => {
singular: true,
scopedCSS: true,
// prefetch: 'all',
// eslint-disable-next-line no-underscore-dangle
// getPublicPath: window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__,
excludeAssetFilter: url =>
url.indexOf('framework/amap/AMap.UI') !== -1 ||
url.indexOf('framework/amap/init.js') !== -1 ||
url.indexOf('configuration/js') !== -1 ||
url.indexOf('framework/three.js') !== -1 ||
url.indexOf('threedimensional/frameworkthree') !== -1 ||
url.indexOf('iframe/Civ3DLLab/js') !== -1 ||
url.indexOf('framework/jquery/gridify-min.js') !== -1 ||
url.indexOf('framework/jquery/gridify.qrcode.js') !== -1 ||
url.indexOf('echarts') !== -1 ||
url.indexOf('lbs.amap.com') !== -1 ||
url.indexOf('restapi.amap.com') !== -1 ||
url.indexOf('webapi.amap.com') !== -1 ||
url.indexOf('webapi.amap.com/count') !== -1 ||
url.indexOf('api.map.baidu.com') !== -1 ||
url.indexOf('map.baidu.com') !== -1 ||
url.indexOf('pv.sohu.com') !== -1 ||
url.indexOf('mt0.google.cn') !== -1 ||
url.indexOf('mt1.google.cn') !== -1 ||
url.indexOf('mt2.google.cn') !== -1 ||
url.indexOf('mt3.google.cn') !== -1 ||
url.indexOf('hm.baidu.com') !== -1 ||
url.indexOf('https://maponline0.bdimg.com') !== -1 ||
url.indexOf('https://maponline1.bdimg.com') !== -1 ||
url.indexOf('https://maponline2.bdimg.com') !== -1 ||
url.indexOf('https://maponline3.bdimg.com') !== -1 ||
url.indexOf('https://api.map.baidu.com/getscript') !== -1,
});
runAfterFirstMounted(() => {
Logger.info('[MainApp] first app mounted');
});
// eslint-disable-next-line no-use-before-define
defaultApp();
addGlobalUncaughtErrorHandler(event => {
const { error } = event;
console.log(event);
const reson = 'Failed to fetch';
if (
error &&
error.message.indexOf(MICRO_STATUS.LOADING_SOURCE_CODE) &&
error.message.indexOf(reson)
) {
// window.history.pushState({message: '应用服务请求异常,请检查应用配置'}, null, '/civbase/500')
}
});
const { error } = event;
console.log(event);
const reson = 'Failed to fetch';
if (
error &&
error.message.indexOf(MICRO_STATUS.LOADING_SOURCE_CODE) &&
error.message.indexOf(reson)
) {
// window.history.pushState({message: '应用服务请求异常,请检查应用配置'}, null, '/civbase/500')
}
});
};
export const defaultApp = () => {
// eslint-disable-next-line no-undef
const config = createStoreage.get('globalConfig');
if (config && config.token) {
debugger
// const startWith = config.homepage ? config.homepage.split('/') : [];
// console.log(findPathByLeafId(config.homepage, '', 'url'))
const basePath =
config.homepage !== '' && FILTER_FOLER_REG.test(config.homepage)
? 'civweb4'
: 'civweb4';
const defaultURL =
config.homepage === ''
? `/${pkg.name.toLocaleLowerCase()}/${basePath}?client=${config.client}`
: `/${pkg.name.toLocaleLowerCase()}/${basePath}/${config.homepage}`;
setDefaultMountApp(defaultURL);
}
// eslint-disable-next-line no-undef
const config = createStoreage.get('globalConfig');
if (config && config.token) {
debugger
// const startWith = config.homepage ? config.homepage.split('/') : [];
// console.log(findPathByLeafId(config.homepage, '', 'url'))
const basePath =
config.homepage !== '' && FILTER_FOLER_REG.test(config.homepage) ?
'civweb4' :
'civweb4';
const defaultURL =
config.homepage === '' ?
`/${pkg.name.toLocaleLowerCase()}/${basePath}?client=${config.client}` :
`/${pkg.name.toLocaleLowerCase()}/${basePath}/${config.homepage}`;
setDefaultMountApp(defaultURL);
}
};
/**
......@@ -193,32 +193,32 @@ export const defaultApp = () => {
*/
window.app = {
modules: {},
require: function(request) {
return this.modules[request]();
},
define: function(name, context, index) {
let keys = context.keys();
for(let key of keys) {
let parts = name.indexOf('@') > -1 ? [name, ...(key.slice(1).split('/'))]:(name + key.slice(1)).split('/');
parts = parts.filter(item => item !== "");
let dir = this.modules;
for (let i = 0; i < parts.length - 1; i++) {
let part = parts[i];
if (!dir.hasOwnProperty(part)) {
dir[part] = {};
modules: {},
require: function(request) {
return this.modules[request]();
},
define: function(name, context, index) {
let keys = context.keys();
for (let key of keys) {
let parts = name.indexOf('@') > -1 ? [name, ...(key.slice(1).split('/'))] : (name + key.slice(1)).split('/');
parts = parts.filter(item => item !== "");
let dir = this.modules;
for (let i = 0; i < parts.length - 1; i++) {
let part = parts[i];
if (!dir.hasOwnProperty(part)) {
dir[part] = {};
}
dir = dir[part];
}
dir[parts[parts.length - 1]] = context.bind(context, key);
}
dir = dir[part];
}
dir[parts[parts.length - 1]] = context.bind(context, key);
}
if(index && index !== null) {
this.modules[name] = this.modules[name][index];
if (index && index !== null) {
this.modules[name] = this.modules[name][index];
}
},
init: function(namespace, reducers) {
[namespace] = reducers;
}
},
init: function(namespace, reducers) {
[namespace] = reducers;
}
};
// window.app.define('city-data', require.context('./components/CitySelector', true, /^.\/(CitySelector\/)?[^\/]+\.js$/), 'city-data.js')
window.app.define('react', require.context('react', true, /^.\/index\.js$/), 'index.js');
......@@ -285,5 +285,4 @@ window.app.define('rc-tree', require.context('../node_modules/rc-tree/lib', true
window.app.define('rc-tree-select', require.context('../node_modules/rc-tree-select/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
window.app.define('rc-trigger', require.context('../node_modules/rc-trigger/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
window.app.define('rc-upload', require.context('../node_modules/rc-upload/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
window.app.define('rc-virtual-list', require.context('../node_modules/rc-virtual-list/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
window.app.define('rc-virtual-list', require.context('../node_modules/rc-virtual-list/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
\ No newline at end of file
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