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
aebc19d3
Commit
aebc19d3
authored
May 27, 2024
by
周宏民
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 演示功能 刷新跳登录页
parent
197c570d
Pipeline
#89077
waiting for manual action with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
2 deletions
+33
-2
index.js
src/pages/bootpage/index.js
+33
-2
No files found.
src/pages/bootpage/index.js
View file @
aebc19d3
...
@@ -7,6 +7,12 @@ import React, { useEffect, useMemo, useState } from 'react';
...
@@ -7,6 +7,12 @@ import React, { useEffect, useMemo, useState } from 'react';
import
{
Empty
,
Spin
,
notification
}
from
'antd'
;
import
{
Empty
,
Spin
,
notification
}
from
'antd'
;
import
SecurityLayout
from
'@/layouts/SecurityLayout'
;
import
SecurityLayout
from
'@/layouts/SecurityLayout'
;
import
{
appService
}
from
'@/api'
;
import
{
appService
}
from
'@/api'
;
import
Cookies
from
'js-cookie'
;
import
_
from
'lodash'
;
import
{
useHistory
,
useAliveController
}
from
'@wisdom-utils/runtime'
;
import
{
connect
}
from
'react-redux'
;
import
{
actionCreators
}
from
'@/containers/App/store'
;
import
{
SERVICE_INTERFACE_SUCCESS_CODE
}
from
'@/constants'
;
import
{
SERVICE_INTERFACE_SUCCESS_CODE
}
from
'@/constants'
;
import
PandaBootPage
from
'./panda'
;
import
PandaBootPage
from
'./panda'
;
import
IntegrationPage
from
'./integration'
;
import
IntegrationPage
from
'./integration'
;
...
@@ -24,6 +30,8 @@ const BootPage = props => {
...
@@ -24,6 +30,8 @@ const BootPage = props => {
loading
:
true
,
loading
:
true
,
error
:
false
,
error
:
false
,
});
});
const
{
clear
}
=
useAliveController
();
const
history
=
useHistory
();
const
[
template
,
setTemplate
]
=
useState
(
'default'
);
const
[
template
,
setTemplate
]
=
useState
(
'default'
);
const
[
pattern
,
setPattern
]
=
useState
(
true
);
// 是否进入演示模式
const
[
pattern
,
setPattern
]
=
useState
(
true
);
// 是否进入演示模式
const
RenderComponent
=
useMemo
(()
=>
{
const
RenderComponent
=
useMemo
(()
=>
{
...
@@ -38,6 +46,18 @@ const BootPage = props => {
...
@@ -38,6 +46,18 @@ const BootPage = props => {
return
BootPageTemplate
[
template
]
||
BootPageTemplate
.
default
;
return
BootPageTemplate
[
template
]
||
BootPageTemplate
.
default
;
},
[
template
,
pattern
]);
},
[
template
,
pattern
]);
useEffect
(()
=>
{
const
tk
=
Cookies
.
get
(
'token'
)
||
props
.
global
.
token
;
const
isLogin
=
tk
!==
null
&&
tk
!==
'undefined'
&&
tk
!==
void
0
;
let
client
=
props
?.
global
?.
client
||
sessionStorage
.
getItem
(
'client'
)
||
null
;
client
=
client
!==
'undefined'
&&
!
_
.
isNull
(
client
)
&&
!
_
.
isUndefined
(
client
)
?
client
:
'city'
;
const
generateType
=
props
.
global
&&
props
.
global
.
hasOwnProperty
(
'get'
)
?
props
.
global
.
get
(
'generateType'
)
:
null
;
if
(
!
isLogin
)
{
history
.
push
(
`/user/login?client=
${
client
}${
generateType
||
''
}
`
,
{
reload
:
true
});
clear
();
props
.
logout
();
}
},
[
clear
,
history
,
props
]);
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
window
?.
globalConfig
?.
isIntegration
>=
1
)
{
if
(
window
?.
globalConfig
?.
isIntegration
>=
1
)
{
setInfo
({
first
:
false
,
loading
:
false
,
error
:
false
});
setInfo
({
first
:
false
,
loading
:
false
,
error
:
false
});
...
@@ -71,5 +91,16 @@ const BootPage = props => {
...
@@ -71,5 +91,16 @@ const BootPage = props => {
<
/SecurityLayout
>
<
/SecurityLayout
>
);
);
};
};
const
mapStateToProps
=
state
=>
({
export
default
BootPage
;
global
:
state
.
getIn
([
'global'
,
'globalConfig'
]),
instance
:
state
.
getIn
([
'global'
,
'instance'
]),
});
const
mapDispatchToProps
=
dispatch
=>
({
logout
()
{
dispatch
(
actionCreators
.
logout
());
},
});
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
,
)(
BootPage
);
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