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

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

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