Commit 47b0d8ef authored by 邓晓峰's avatar 邓晓峰

fix: 处理当没有配置首页的时候, 优化url匹配规则

parent 4ad5c29e
Pipeline #46820 skipped with stages
...@@ -9,27 +9,27 @@ export default { ...@@ -9,27 +9,27 @@ export default {
// container: '#micro-container', // container: '#micro-container',
// activeRule: '/civbase/civ_energy', // activeRule: '/civbase/civ_energy',
// }, // },
// {
// name: 'civ_water',
// entry: `//${window.location.hostname}:8081/civ_water`,
// container: '#micro-container',
// activeRule: '/civbase/civ_water',
// },
{
name: 'civ_configuration',
entry: `//${window.location.hostname}:8080/civ_configuration`,
container: '#micro-container',
activeRule: '/civbase/civ_configuration',
},
{ {
name: 'report', name: 'civ_water',
entry: `//127.0.0.1:8345/report/workplatform`, entry: `//${window.location.hostname}:8080/civ_water`,
container: '#micro-container', container: '#micro-container',
activeRule: '/civbase/report', activeRule: '/civbase/civ_water',
props: {
origin: `//127.0.0.1:8345`,
},
}, },
// {
// name: 'civ_configuration',
// entry: `//${window.location.hostname}:8080/civ_configuration`,
// container: '#micro-container',
// activeRule: '/civbase/civ_configuration',
// },
// {
// name: 'report',
// entry: `//127.0.0.1:8345/report/workplatform`,
// container: '#micro-container',
// activeRule: '/civbase/report',
// props: {
// origin: `//127.0.0.1:8345`,
// },
// },
{ {
name: 'civ_webgis', name: 'civ_webgis',
entry: `//${window.location.hostname}:8081/civ_webgis`, entry: `//${window.location.hostname}:8081/civ_webgis`,
...@@ -42,18 +42,18 @@ export default { ...@@ -42,18 +42,18 @@ export default {
container: '#micro-container', container: '#micro-container',
activeRule: '/civbase/civweb4', activeRule: '/civbase/civweb4',
}, },
{ // {
name: 'middleground', // name: 'middleground',
entry: `//${window.location.hostname}:8082/middleground`, // entry: `//${window.location.hostname}:8082/middleground`,
container: '#micro-container', // container: '#micro-container',
activeRule: '/civbase/middleground', // activeRule: '/civbase/middleground',
}, // },
{ // {
name: 'civ_3d', // name: 'civ_3d',
entry: `//${window.location.hostname}:12000/civ_3d`, // entry: `//${window.location.hostname}:12000/civ_3d`,
container: '#micro-container', // container: '#micro-container',
activeRule: '/civbase/civ_3d', // activeRule: '/civbase/civ_3d',
}, // },
], ],
prod: [ prod: [
{ {
......
/* 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 = 'https://work.panda-water.cn'; // const proxyURL = 'https://work.panda-water.cn';
const proxyURL = 'http://192.168.12.47:8082'; const proxyURL = 'https://panda-water.cn';
module.exports = { module.exports = {
......
...@@ -30,7 +30,9 @@ const initLocale = () => { ...@@ -30,7 +30,9 @@ const initLocale = () => {
initGlobalConfig(); initGlobalConfig();
initLocale(); initLocale();
const unlisten = history.listen(location => { const unlisten = history.listen(location => {
if(location.pathname.indexOf('/civbase/user/login') > -1) { if(location.pathname.indexOf('/civbase/user/login') > -1) {
console.log('init config')
initGlobalConfig(); initGlobalConfig();
} }
}); });
......
...@@ -93,6 +93,7 @@ export const initGlobalConfig = () => { ...@@ -93,6 +93,7 @@ export const initGlobalConfig = () => {
} }
// eslint-disable-next-line no-new // eslint-disable-next-line no-new
if (getToken()) { if (getToken()) {
// eslint-disable-next-line no-new // eslint-disable-next-line no-new
new Login( new Login(
{ {
......
...@@ -268,7 +268,6 @@ const BasicLayout = props => { ...@@ -268,7 +268,6 @@ const BasicLayout = props => {
// 处理隐藏菜单 // 处理隐藏菜单
let currentRoutes = props.route.routes.filter(item => !item.hideInMenu)[props.currentMenuIndex]; let currentRoutes = props.route.routes.filter(item => !item.hideInMenu)[props.currentMenuIndex];
console.log(props.route)
//props.currentMenuIndex //props.currentMenuIndex
useEffect(() => { useEffect(() => {
const initSelectRoute = findPathByLeafId( const initSelectRoute = findPathByLeafId(
......
...@@ -321,6 +321,7 @@ class Site { ...@@ -321,6 +321,7 @@ class Site {
} }
writeCookie(token, site) { writeCookie(token, site) {
const date = new Date(); const date = new Date();
date.setTime(date.getTime() + 24 * 60 * 60 * 1000); date.setTime(date.getTime() + 24 * 60 * 60 * 1000);
// date = date.toGMTString(); // date = date.toGMTString();
...@@ -341,6 +342,7 @@ class Site { ...@@ -341,6 +342,7 @@ class Site {
const self = this; const self = this;
self.props.updateCurrentIndex && self.props.updateCurrentIndex(-1); self.props.updateCurrentIndex && self.props.updateCurrentIndex(-1);
const login = new Login(this.props, () => { const login = new Login(this.props, () => {
self.setLoading(false); self.setLoading(false);
// eslint-disable-next-line no-unused-expressions // eslint-disable-next-line no-unused-expressions
self.props.updateCurrentIndex && self.props.updateCurrentIndex(0); self.props.updateCurrentIndex && self.props.updateCurrentIndex(0);
......
This diff is collapsed.
...@@ -47,7 +47,7 @@ export const dyRoutes = (routes, layout) => { ...@@ -47,7 +47,7 @@ export const dyRoutes = (routes, layout) => {
{ {
path: '/commonmenu', path: '/commonmenu',
component: CommonMenu, component: CommonMenu,
name: '菜单收藏' // name: '菜单收藏'
}, },
{ {
path: '/iframe', path: '/iframe',
......
const camelizeRE = /-(\w)/g
export function camelize (str) {
str = String(str)
return str.replace(camelizeRE, function (m, c) {
return c ? c.toUpperCase() : ''
})
}
export function kebab (str) {
str = String(str)
return str.replace(/([A-Z])/g, '-$1').toLowerCase()
}
\ No newline at end of file
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import pathRegexp from 'path-to-regexp'; import pathRegexp from 'path-to-regexp';
import { parse } from 'querystring'; import { parse } from 'querystring';
import { camelize } from './strings';
import pkg from '../../package.json'; import pkg from '../../package.json';
const { toString } = Object.prototype; const { toString } = Object.prototype;
...@@ -169,3 +169,13 @@ export function setToken(token) { ...@@ -169,3 +169,13 @@ export function setToken(token) {
Cookies.set(token); Cookies.set(token);
} }
export const closeTabAction = (history, returnUrl, callback) => {}; export const closeTabAction = (history, returnUrl, callback) => {};
export function processComponentName(name, { prefix = '', firstUpperCase = false } = {}) {
const pureName = name;
let camelizeName = `${camelize(`${prefix}${pureName}`)}`
if (firstUpperCase) {
camelizeName = camelizeName.charAt(0).toUpperCase() + camelizeName.slice(1)
}
return camelizeName
}
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