Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivWeb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivWeb
Commits
47b0d8ef
Commit
47b0d8ef
authored
Mar 29, 2022
by
邓晓峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 处理当没有配置首页的时候, 优化url匹配规则
parent
4ad5c29e
Pipeline
#46820
skipped with stages
Changes
10
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
61 additions
and
34 deletions
+61
-34
micor.js
config/micor.js
+30
-30
proxy.js
config/proxy.js
+1
-1
app.js
src/app.js
+2
-0
initConfig.js
src/initConfig.js
+1
-0
BasicLayout1.js
src/layouts/BasicLayout1.js
+0
-1
Site.js
src/layouts/Site.js
+2
-0
micro.js
src/micro.js
+0
-0
config.js
src/routes/config.js
+1
-1
strings.js
src/utils/strings.js
+13
-0
utils.js
src/utils/utils.js
+11
-1
No files found.
config/micor.js
View file @
47b0d8ef
...
...
@@ -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
:
[
{
...
...
config/proxy.js
View file @
47b0d8ef
/* 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
=
'http
s://panda-water.cn
'
;
module
.
exports
=
{
...
...
src/app.js
View file @
47b0d8ef
...
...
@@ -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
();
}
});
...
...
src/initConfig.js
View file @
47b0d8ef
...
...
@@ -93,6 +93,7 @@ export const initGlobalConfig = () => {
}
// eslint-disable-next-line no-new
if
(
getToken
())
{
// eslint-disable-next-line no-new
new
Login
(
{
...
...
src/layouts/BasicLayout1.js
View file @
47b0d8ef
...
...
@@ -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
(
...
...
src/layouts/Site.js
View file @
47b0d8ef
...
...
@@ -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
);
...
...
src/micro.js
View file @
47b0d8ef
This diff is collapsed.
Click to expand it.
src/routes/config.js
View file @
47b0d8ef
...
...
@@ -47,7 +47,7 @@ export const dyRoutes = (routes, layout) => {
{
path
:
'/commonmenu'
,
component
:
CommonMenu
,
name
:
'菜单收藏'
//
name: '菜单收藏'
},
{
path
:
'/iframe'
,
...
...
src/utils/strings.js
0 → 100644
View file @
47b0d8ef
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
src/utils/utils.js
View file @
47b0d8ef
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
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment