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