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
3910aab1
Commit
3910aab1
authored
Jan 17, 2022
by
张瑶
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 重定向传递generateType参数,修复client=undefined问题
parent
12c539fd
Pipeline
#42883
passed with stages
in 1 minute 36 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
BasicLayout1.js
src/layouts/BasicLayout1.js
+4
-2
SecurityLayout.js
src/layouts/SecurityLayout.js
+4
-6
No files found.
src/layouts/BasicLayout1.js
View file @
3910aab1
...
...
@@ -332,8 +332,10 @@ const BasicLayout = props => {
siteAction
.
setGlobalConfig
(
props
.
global
);
if
(
!
Cookies
.
get
(
'token'
))
{
let
client
=
props
.
global
&&
props
.
global
.
client
;
client
=
client
!==
'undefined'
||
!
_
.
isNull
(
client
)
||
!
_
.
isUndefined
(
client
)
?
client
:
'city'
;
history
.
replace
(
`/user/login?client=
${
client
}
`
);
client
=
client
!==
'undefined'
&&
!
_
.
isNull
(
client
)
&&
!
_
.
isUndefined
(
client
)
?
client
:
'city'
;
let
generateType
=
props
.
global
.
get
(
'generateType'
);
generateType
=
!
_
.
isNull
(
generateType
)
&&
!
_
.
isUndefined
(
generateType
)
&&
generateType
!==
'undefined'
?
`&generateType=
${
generateType
}
`
:
''
;
history
.
replace
(
`/user/login?client=
${
client
}${
generateType
}
`
);
props
.
logout
();
return
;
}
...
...
src/layouts/SecurityLayout.js
View file @
3910aab1
...
...
@@ -21,23 +21,21 @@ 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,
// });
if
(
_
.
isNull
(
global
.
token
)
||
(
global
.
hasGateWay
&&
_
.
isNull
(
global
.
access_token
)))
{
debugger
this
.
props
.
updateCurrentIndex
&&
this
.
props
.
updateCurrentIndex
(
0
);
let
client
=
global
.
client
||
Cookies
.
get
(
'city'
);
client
=
client
!==
'undefined'
||
!
_
.
isNull
(
client
)
||
!
_
.
isUndefined
(
client
)
?
client
:
'city'
;
client
=
client
!==
'undefined'
&&
!
_
.
isNull
(
client
)
&&
!
_
.
isUndefined
(
client
)
?
client
:
'city'
;
// event.emit(?'event:initConfig');
let
generateType
=
global
.
generateType
;
generateType
=
!
_
.
isNull
(
generateType
)
&&
!
_
.
isUndefined
(
generateType
)
&&
generateType
!==
'undefined'
?
`&generateType=
${
generateType
}
`
:
''
;
return
(
<
Redirect
to
=
{
`/user/login?client=
${
client
}
`
}
render
=
{()
=>
window
.
location
.
reload
()}
/
>
<
Redirect
to
=
{
`/user/login?client=
${
client
}
${
generateType
}
`
}
render
=
{()
=>
window
.
location
.
reload
()}
/
>
);
}
...
...
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