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
97014fda
Commit
97014fda
authored
3 years ago
by
邓晓峰
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://g.civnet.cn:8443/ReactWeb5/CivWeb
parents
731fee38
5b7b9c83
master
dev
devNew
feat/layout-flat
patch-1
soundai
test
zhongyi
No related merge requests found
Pipeline
#38936
passed with stages
in 13 minutes 40 seconds
Changes
9
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
56 additions
and
37 deletions
+56
-37
proxy.js
config/proxy.js
+1
-1
app.js
src/app.js
+11
-8
index.js
src/components/Container/index.js
+3
-5
AvatarDropdown.js
src/components/GlobalHeader/AvatarDropdown.js
+5
-3
ExtendPanel.js
src/components/HeaderSearch/ExtendPanel.js
+1
-1
actions.js
src/containers/App/store/actions.js
+3
-0
reducer.js
src/containers/App/store/reducer.js
+7
-5
SecurityLayout.js
src/layouts/SecurityLayout.js
+22
-12
micro.js
src/micro.js
+3
-2
No files found.
config/proxy.js
View file @
97014fda
/* eslint-disable */
// const proxyURL = process.env.NODE_ENV !== 'production' ? 'http://192.168.10.150:8777' : window.location.origin;
const
proxyURL
=
'https://
panda-water.com
'
;
const
proxyURL
=
'https://
mis.panda-water.cn
'
;
module
.
exports
=
{
assetsRoot
:
process
.
env
.
NODE_ENV
!==
'production'
?
proxyURL
:
'./'
,
dev
:
{
...
...
This diff is collapsed.
Click to expand it.
src/app.js
View file @
97014fda
...
...
@@ -110,7 +110,7 @@ const initGlobalConfig = () => {
appService
.
getWateWayConfig
().
then
(
res
=>
{
const
hasGateWay
=
res
&&
res
.
data
&&
isString
(
res
.
data
)
?
JSON
.
parse
(
res
.
data
)
:
res
.
data
;
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
&&
res
.
data
===
'true'
)
{
store
.
dispatch
(
actionCreators
.
getConfig
(
Object
.
assign
({},
window
.
globalConfig
,
{
...
...
@@ -124,7 +124,7 @@ const initGlobalConfig = () => {
// eslint-disable-next-line react-hooks/rules-of-hooks
appService
.
queryConfig
({
client
:
params
.
getParams
(
'client'
)
||
Cookies
.
get
(
'city'
)
||
'city'
,
client
:
params
.
getParams
(
'client'
)
||
'city'
,
})
.
then
(
res
=>
{
if
(
res
)
{
...
...
@@ -132,14 +132,14 @@ const initGlobalConfig = () => {
if
(
!
data
.
client
)
{
data
.
client
=
params
.
getParams
(
'client'
)
||
'city'
;
}
Cookies
.
set
(
'city'
,
data
.
client
);
Cookies
.
set
(
'city'
,
Cookies
.
get
(
'city'
)
);
store
.
dispatch
(
actionCreators
.
getConfig
(
Object
.
assign
({},
window
.
globalConfig
,
data
),
),
);
Cookies
.
set
(
'city'
,
params
.
getParams
(
'client'
))
//
Cookies.set('city', params.getParams('client'))
if
(
data
.
loginTemplate
===
'新春 - 智联.html'
)
{
updateTheme
(
'#ff9600'
);
...
...
@@ -187,6 +187,8 @@ const initGlobalConfig = () => {
}
};
const
initSensorType
=
()
=>
{
let
filterProduct
=
(
window
.
globalConfig
&&
window
.
globalConfig
.
products
)
||
[];
...
...
@@ -224,11 +226,12 @@ const initIsMock = () => {
initGlobalConfig
();
initLocale
();
window
.
share
&&
window
.
share
.
event
&&
window
.
share
.
event
.
on
(
'triggerMicro'
,
()
=>
{
window
.
share
&&
window
.
share
.
event
&&
window
.
share
.
event
.
on
(
'triggerMicro'
,
()
=>
{
initMicroApps
(
loader
,
store
);
});
});
window
.
share
&&
window
.
share
.
event
&&
window
.
share
.
event
.
on
(
'initConfig'
,
()
=>
{
initGlobalConfig
();
});
if
(
pwa
)
{
// const appPWA = window.i18n.getI18n('app');
...
...
This diff is collapsed.
Click to expand it.
src/components/Container/index.js
View file @
97014fda
...
...
@@ -12,11 +12,9 @@ export default class Container extends React.Component {
}
oms
(
event
)
{
const
omsUrl
=
[
`
${
window
.
location
.
protocol
}
//:`
,
MaintenanceHost
,
MaintenancePath
,
].
join
(
'/'
);
const
omsUrl
=
`
${
MaintenanceHost
}
/
${
MaintenancePath
}
`
;
console
.
log
(
omsUrl
)
window
.
open
(
omsUrl
,
'_blank'
);
}
...
...
This diff is collapsed.
Click to expand it.
src/components/GlobalHeader/AvatarDropdown.js
View file @
97014fda
...
...
@@ -11,7 +11,7 @@ import {
Upload
,
}
from
'antd'
;
import
{
withRouter
}
from
'react-router'
;
import
Cookies
from
'js-cookie'
;
import
{
FormattedMessage
,
useIntl
,
...
...
@@ -61,7 +61,6 @@ class AvatarDropdown extends React.Component {
}
}
loginout
=
event
=>
{
debugger
// eslint-disable-next-line no-undef
this
.
props
.
logout
();
if
(
...
...
@@ -71,7 +70,10 @@ class AvatarDropdown extends React.Component {
window
.
location
.
href
=
`
${
window
.
location
.
origin
}
/#login`
;
return
false
;
}
window
.
location
.
reload
();
// console.log(this.props)
// this.props.history.push('/login')
// window.location.reload();
//
};
getRoles
=
()
=>
{
...
...
This diff is collapsed.
Click to expand it.
src/components/HeaderSearch/ExtendPanel.js
View file @
97014fda
...
...
@@ -105,7 +105,7 @@ const SearchPanel = props => {
}
const
goFeature
=
(
path
,
rect
,
value
)
=>
{
// eslint-disable-next-line no-param-reassign
debugger
value
=
value
||
props
.
value
;
const
findKeywordIndex
=
recentKeywords
.
length
>
0
...
...
This diff is collapsed.
Click to expand it.
src/containers/App/store/actions.js
View file @
97014fda
...
...
@@ -177,6 +177,9 @@ export function logout(data) {
Cookies
.
set
(
window
.
globalConfig
.
client
,
''
,
{
path
:
'/'
,
});
window
.
globalConfig
.
token
=
null
;
window
.
globalConfig
.
access_token
=
null
;
window
.
globalConfig
.
hasGateWay
=
false
;
}
Cookies
.
set
(
'token'
,
''
,
{
...
...
This diff is collapsed.
Click to expand it.
src/containers/App/store/reducer.js
View file @
97014fda
...
...
@@ -102,11 +102,14 @@ const appReducer = (state = initialState, action) => {
// eslint-disable-next-line no-case-declarations
const
{
homepage
}
=
window
.
globalConfig
;
const
modulePkg
=
{};
window
.
globalConfig
.
products
.
map
(
item
=>
{
window
.
globalConfig
&&
window
.
globalConfig
.
products
&&
Array
.
isArray
(
window
.
globalConfig
.
products
)
&&
window
.
globalConfig
.
products
.
map
(
item
=>
{
modulePkg
[
item
.
PackageName
]
=
item
;
})
})
;
const
generMenu
=
generRoutes
(
config
.
widgets
||
[],
null
,
0
,
modulePkg
);
const
flatMenu
=
generFlatRoutes
(
generMenu
||
[],
null
,
null
,
modulePkg
);
let
flatMenu
=
[];
if
(
generMenu
)
{
flatMenu
=
generFlatRoutes
(
generMenu
||
[],
null
,
null
,
modulePkg
);
}
const
home
=
flatMenu
.
find
(
item
=>
{
let
path
=
item
.
path
.
split
(
"|"
);
...
...
@@ -119,7 +122,6 @@ const appReducer = (state = initialState, action) => {
let
currentMenuIndex
=
0
;
if
(
home
)
{
console
.
log
(
"home"
,
home
);
const
parent
=
home
.
level
>=
2
?
home
.
parent
.
parent
:
home
.
level
>=
3
?
home
.
parent
.
parent
.
parent
:
home
.
parent
;
if
(
parent
)
{
...
...
@@ -139,7 +141,7 @@ const appReducer = (state = initialState, action) => {
Cookies
.
set
(
'city'
,
Cookies
.
get
(
'city'
)
||
window
.
globalConfig
.
client
);
return
state
.
merge
({
globalConfig
:
config
,
menu
:
generMenu
,
menu
:
generMenu
||
[]
,
flatMenu
,
currentMenu
:
generMenu
&&
generMenu
[
state
.
currentMenuIndex
],
});
...
...
This diff is collapsed.
Click to expand it.
src/layouts/SecurityLayout.js
View file @
97014fda
import
React
from
'react'
;
import
Cookies
from
'js-cookie'
;
import
{
connect
}
from
'react-redux'
;
import
{
Redirect
}
from
'
react-router-dom
'
;
import
{
Redirect
}
from
'
@wisdom-utils/runtime
'
;
import
{
PageLoading
}
from
'@ant-design/pro-layout'
;
import
{
stringify
}
from
'querystring'
;
import
{
getBaseName
}
from
'../utils/utils'
;
import
_
from
'lodash'
;
class
SecurityLayout
extends
React
.
Component
{
state
=
{
...
...
@@ -19,25 +20,34 @@ class SecurityLayout extends React.Component {
}
render
()
{
const
{
isReady
}
=
this
.
state
;
const
{
children
,
global
,
loading
}
=
this
.
props
;
const
isLogin
=
Cookies
.
get
(
'token'
)
!==
null
&&
global
.
token
!==
null
;
const
queryString
=
stringify
({
redirect
:
window
.
location
.
href
,
});
//
const queryString = stringify({
//
redirect: window.location.href,
//
});
if
((
!
isLogin
&&
loading
)
||
!
isReady
)
{
return
<
PageLoading
/>
;
}
if
(
!
isLogin
&&
window
.
location
.
pathname
!==
`/
${
getBaseName
()}
/user/login`
)
{
if
(
_
.
isNull
(
global
.
token
)
||
(
global
.
hasGateWay
&&
_
.
isNull
(
global
.
access_token
)))
{
this
.
props
.
updateCurrentIndex
&&
this
.
props
.
updateCurrentIndex
(
0
);
window
.
share
&&
window
.
share
.
event
&&
window
.
share
.
event
.
emit
(
'initConfig'
)
return
(
<
Redirect
to
=
{
`/user/login?client=
${
global
.
client
}
&
${
queryString
}
`
}
/
>
<
Redirect
to
=
{
`/user/login?client=
${
global
.
client
}
`
}
/
>
);
}
if
((
!
isLogin
&&
loading
)
||
!
isReady
)
{
return
<
PageLoading
/>
;
}
// if (
// !isLogin &&
// window.location.pathname !== `/${getBaseName()}/user/login`
// ) {
// this.props.updateCurrentIndex && this.props.updateCurrentIndex(0);
// return (
// <Redirect to={`/user/login?client=${global.client}&${queryString}`} />
// );
// }
return
children
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/micro.js
View file @
97014fda
...
...
@@ -199,7 +199,8 @@ export const defaultApp = () => {
if
(
config
&&
config
.
home
)
{
setDefaultMountApp
(
`/civbase/
${
config
.
home
.
path
.
replace
(
/^
\/
/
,
''
)}
`
);
}
else
{
setDefaultMountApp
(
`/
${
pkg
.
name
.
toLocaleLowerCase
()}
/
${
basePath
}
/
${
config
.
homepage
}
`
);
const
homepage
=
config
.
homepage
?
'/'
+
config
.
homepage
:
''
;
setDefaultMountApp
(
`/
${
pkg
.
name
.
toLocaleLowerCase
()}
/
${
basePath
}${
homepage
}
`
);
createStoreage
.
set
(
'init_web4'
,
true
)
}
...
...
@@ -225,7 +226,7 @@ window.app = {
if
(
request
===
'.'
)
{
return
}
return
this
.
modules
[
request
]();
return
_
.
isFunction
(
this
.
modules
[
request
])
&&
this
.
modules
[
request
]();
},
define
:
function
(
name
,
context
,
index
)
{
let
keys
=
context
.
keys
();
...
...
This diff is collapsed.
Click to expand it.
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