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
a753f7f7
Commit
a753f7f7
authored
Apr 25, 2022
by
曾婧
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://g.civnet.cn:8443/ReactWeb5/CivWeb
parents
c79783a1
35442c9e
Pipeline
#48628
passed with stages
in 2 minutes 19 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
8 deletions
+11
-8
BasicLayout.js
src/layouts/BasicLayout.js
+4
-4
SecurityLayout.js
src/layouts/SecurityLayout.js
+3
-3
Site.js
src/layouts/Site.js
+4
-0
login.js
src/pages/user/login/login.js
+0
-1
No files found.
src/layouts/BasicLayout.js
View file @
a753f7f7
...
...
@@ -45,8 +45,7 @@ const ArrowIcon = props => <Icon component={arrowSvg} {...props} />;
const
optionsWith
=
[{
label
:
'按站点'
,
value
:
'site'
},
{
label
:
'按城市'
,
value
:
'city'
}];
const
HOT
=
[
'HOT'
,
'县'
,
'市'
,
'New'
];
const
StationsItem
=
(
item
,
action
,
onChangeVisible
)
=>
{
const
changeGroup
=
(
event
,
data
)
=>
{
debugger
;
const
changeGroup
=
(
event
,
data
)
=>
{
action
.
changeGroup
&&
action
.
changeGroup
(
event
,
data
,
onChangeVisible
);
};
return
(
...
...
@@ -191,7 +190,9 @@ const Layout = props => {
const
history
=
useHistory
();
useEffect
(()
=>
{
siteAction
.
setGlobalConfig
(
props
.
global
);
if
(
!
Cookies
.
get
(
'token'
))
{
const
tk
=
Cookies
.
get
(
'token'
)
||
props
.
global
.
token
;
const
isLogin
=
tk
!==
null
&&
tk
!==
'undefined'
&&
tk
!==
(
void
0
);
if
(
!
isLogin
)
{
let
client
=
props
.
global
&&
props
.
global
.
hasOwnProperty
(
'client'
)
?
props
.
global
.
get
(
'client'
)
:
null
;
client
=
client
!==
'undefined'
&&
!
_
.
isNull
(
client
)
&&
!
_
.
isUndefined
(
client
)
?
client
:
'city'
;
let
generateType
=
props
.
global
&&
props
.
global
.
hasOwnProperty
(
'get'
)
?
props
.
global
.
get
(
'generateType'
)
:
null
;
...
...
@@ -231,7 +232,6 @@ const Layout = props => {
useEffect
(()
=>
{
window
.
share
.
event
.
on
(
'updateSite'
,
res
=>
{
debugger
;
setCityData
(
res
);
});
return
()
=>
{
...
...
src/layouts/SecurityLayout.js
View file @
a753f7f7
...
...
@@ -45,8 +45,8 @@ 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
tk
=
Cookies
.
get
(
'token'
)
||
global
.
token
;
const
isLogin
=
tk
!==
null
&&
tk
!==
'undefined'
&&
tk
!==
(
void
0
);
if
(
!
isLogin
&&
window
.
location
.
pathname
!==
'/civbase/user/login'
)
{
const
{
query
=
{},
search
,
pathname
}
=
history
.
location
;
const
{
redirect
}
=
query
;
...
...
@@ -54,7 +54,7 @@ class SecurityLayout extends React.Component {
// redirect: pathname + search,
// });
this
.
props
.
updateCurrentIndex
&&
this
.
props
.
updateCurrentIndex
(
0
);
let
client
=
global
.
client
||
Cookies
.
get
(
'c
ity
'
);
let
client
=
global
.
client
||
Cookies
.
get
(
'c
lient
'
);
client
=
client
!==
'undefined'
&&
!
_
.
isNull
(
client
)
&&
!
_
.
isUndefined
(
client
)
?
client
:
'city'
;
let
{
generateType
}
=
global
;
generateType
=
!
_
.
isNull
(
generateType
)
&&
!
_
.
isUndefined
(
generateType
)
&&
generateType
!==
'undefined'
?
`&generateType=
${
generateType
}
`
:
''
;
...
...
src/layouts/Site.js
View file @
a753f7f7
...
...
@@ -361,6 +361,10 @@ class Site {
window
.
share
&&
window
.
share
.
event
&&
window
.
share
.
event
.
emit
(
'reloadNotice'
);
const
config
=
self
.
globalConfig
;
let
url
=
!
config
.
home
?
((
config
.
homepage
===
''
||
_
.
isNull
(
config
.
homepage
))
?
`/civweb4`
:
`/civweb4/
${
config
.
homepage
.
replace
(
/^
\/
/
,
''
).
replace
(
/^civweb4
\/
/
,
''
)}
`
)
:
`/
${
config
.
homepage
.
replace
(
/^
\/
/
,
''
)}
`
;
// 在云平台上,切换前后如果url一致会出问题
if
(
config
.
userInfo
&&
config
.
userInfo
.
site
)
{
url
+=
`
${
url
.
indexOf
(
'|'
)
>
-
1
?
'&'
:
'|'
}
__site__=
${
config
.
userInfo
.
site
}
`
;
}
self
.
props
.
history
&&
self
.
props
.
history
.
push
(
url
);
self
.
props
&&
self
.
props
.
updateCollapsed
&&
self
.
props
.
updateCollapsed
(
false
);
window
.
share
.
event
.
emit
(
'triggerMicro'
,
this
.
props
.
global
);
...
...
src/pages/user/login/login.js
View file @
a753f7f7
...
...
@@ -914,7 +914,6 @@ class Login {
const
self
=
this
;
const
token
=
response
&&
(
response
.
token
?
response
.
token
:
(
response
.
access_token
!==
null
&&
response
.
user_token
!==
null
)
?
response
.
user_token
:
''
);
if
(
token
)
{
Cookies
.
set
(
'token'
,
token
);
const
exp
=
86400000
;
self
.
globalConfig
.
token
=
token
;
if
(
response
.
access_token
!==
""
)
{
...
...
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