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
7d920eea
Commit
7d920eea
authored
Sep 09, 2024
by
周宏民
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:弥勒集成登录 支持client
parent
c5efa399
Pipeline
#92457
waiting for manual action with stages
Changes
7
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
75 additions
and
25 deletions
+75
-25
actions.js
src/containers/App/store/actions.js
+10
-1
BasicLayout.js
src/layouts/BasicLayout.js
+5
-0
login.js
src/pages/bootpage/demonstration/components/login.js
+0
-0
data.json
src/pages/bootpage/template/project/mile/data.json
+4
-4
index.js
src/pages/bootpage/template/project/mile/index.js
+46
-10
index.less
src/pages/bootpage/template/project/mile/index.less
+8
-8
index.js
src/pages/integratedLogin/index.js
+2
-2
No files found.
src/containers/App/store/actions.js
View file @
7d920eea
...
...
@@ -188,8 +188,9 @@ export function updatePdCesiumView(data) {
export
function
logout
(
data
)
{
// eslint-disable-next-line no-undef
createStoreage
.
remove
(
'PANDA_STORE'
);
const
integrationClient
=
localStorage
.
getItem
(
'integrationClient'
);
if
(
window
.
globalConfig
)
{
Cookies
.
set
(
window
.
globalConfig
.
client
,
''
,
{
Cookies
.
set
(
integrationClient
||
window
.
globalConfig
.
client
,
''
,
{
path
:
'/'
,
});
window
.
globalConfig
.
token
=
null
;
...
...
@@ -198,6 +199,9 @@ export function logout(data) {
window
.
globalConfig
.
baseURI
=
window
.
location
.
origin
;
window
.
globalConfig
.
hasGateWay
=
false
;
window
.
globalConfig
.
userInfo
=
null
;
if
(
integrationClient
)
{
window
.
globalConfig
.
client
=
integrationClient
;
}
window
.
qiankunIsCache
=
null
;
window
.
qiankunStarted
=
false
;
// window.globalConfig.hasGateWay = ;
...
...
@@ -220,6 +224,11 @@ export function logout(data) {
Cookies
.
set
(
'singleToken'
,
''
,
{
path
:
'/'
,
});
// 如果有集成登录client,则 client 切换成集成登录
if
(
integrationClient
)
{
sessionStorage
.
setItem
(
'client'
,
integrationClient
);
}
localStorage
.
removeItem
(
'integrationClient'
);
localStorage
.
removeItem
(
'access_token'
);
localStorage
.
removeItem
(
'password_token'
);
localStorage
.
removeItem
(
'password_pwdRegex'
);
...
...
src/layouts/BasicLayout.js
View file @
7d920eea
...
...
@@ -326,6 +326,8 @@ const Layout = props => {
!
_
.
isNull
(
generateType
)
&&
!
_
.
isUndefined
(
generateType
)
&&
generateType
!==
'undefined'
?
`&generateType=
${
generateType
}
`
:
''
;
const
integrationClient
=
localStorage
.
getItem
(
'integrationClient'
);
if
(
integrationClient
)
client
=
integrationClient
if
(
!
isLogin
)
{
history
.
push
(
`/user/login?client=
${
client
}${
generateType
}
`
,
{
reload
:
true
});
clear
();
...
...
@@ -385,11 +387,14 @@ const Layout = props => {
const
GetIntegrationConfig
=
()
=>
{
if
(
first
)
{
const
integrationClient
=
localStorage
.
getItem
(
'integrationClient'
);
appService
.
GetIntegrationConfig
({
type
:
'集成登录'
,
userId
:
window
.
globalConfig
.
userInfo
?.
OID
??
null
,
isEnable
:
true
,
client
:
integrationClient
||
''
// 只有指定client才能获取集成登录信息
})
.
then
(
res
=>
{
setFirst
(
false
);
...
...
src/pages/bootpage/demonstration/components/login.js
View file @
7d920eea
This diff is collapsed.
Click to expand it.
src/pages/bootpage/template/project/mile/data.json
View file @
7d920eea
...
...
@@ -33,28 +33,28 @@
"english"
:
"Monitoring Center"
,
"label"
:
""
,
"url"
:
""
,
"client"
:
""
"client"
:
"
scada
"
},
{
"name"
:
"控漏管控"
,
"english"
:
"Leakage control"
,
"label"
:
""
,
"url"
:
""
,
"client"
:
""
"client"
:
"
DMA
"
},
{
"name"
:
"业务中心"
,
"english"
:
"Business center"
,
"label"
:
""
,
"url"
:
""
,
"client"
:
""
"client"
:
"
business
"
},
{
"name"
:
"工单中心"
,
"english"
:
"Ticket center"
,
"label"
:
""
,
"url"
:
""
,
"client"
:
""
"client"
:
"
work
"
}
],
"标题"
:
"弥勒自来水公司信息化平台"
,
...
...
src/pages/bootpage/template/project/mile/index.js
View file @
7d920eea
...
...
@@ -36,15 +36,13 @@ const boxHeight = 930;
const
IntegrationMile
=
props
=>
{
const
[
ref
,
isFullscreen
,
handleFullScreen
,
handleExitFullScreen
]
=
useFullScreen
(
false
);
const
history
=
useHistory
();
const
globalClient
=
window
?.
globalConfig
?.
client
||
'city'
;
let
integrationClient
=
window
?.
globalConfig
?.
client
||
'city'
;
// 集成登录client
const
timer2
=
useRef
(
null
);
const
timer3
=
useRef
(
null
);
const
timer4
=
useRef
(
null
);
const
progressRef2
=
useRef
(
0
);
const
[
loginAction
,
setAction
]
=
useState
(()
=>
new
LoginAction
(
props
));
const
[
dataList
,
setDataList
]
=
useState
([]);
// 集成登录详情
const
[
currentType
,
setCurrentType
]
=
useState
(
''
);
const
[
mClient
,
setMClient
]
=
useState
(
''
);
const
{
clear
}
=
useAliveController
();
...
...
@@ -60,6 +58,8 @@ const IntegrationMile = props => {
scale
:
1
,
boxHeight
:
930
,
});
const
[
integrationData
,
setIntegrationData
]
=
useState
({});
const
[
linkUrl
,
setLinkUrl
]
=
useState
(
''
);
const
[
jumpLoading
,
setJumpLoading
]
=
useState
(
false
);
const
[
progressValue2
,
setProgressValue2
]
=
useState
(
0
);
...
...
@@ -103,6 +103,35 @@ const IntegrationMile = props => {
setConfigData
(
data
);
}
});
appService
.
GetIntegratedloginSetting
({
ignoreSite
:
true
,
})
.
then
(
res
=>
{
const
{
code
,
data
}
=
res
;
if
(
data
.
client
)
{
integrationClient
=
data
.
client
;
localStorage
.
setItem
(
'integrationClient'
,
data
.
client
);
if
(
integrationClient
)
{
if
(
!
data
.
client
)
return
;
appService
.
GetIntegrationConfig
({
type
:
'集成登录'
,
userId
:
window
.
globalConfig
.
userInfo
?.
OID
??
null
,
isEnable
:
true
,
client
:
data
.
client
||
''
,
})
.
then
(
res1
=>
{
const
list
=
res1
.
data
||
[];
const
obj
=
{};
list
.
forEach
(
d
=>
{
obj
[
d
.
name
]
=
true
;
});
setIntegrationData
(
obj
);
});
}
}
});
};
const
onResize
=
()
=>
{
if
(
ref
?.
current
)
{
...
...
@@ -193,6 +222,10 @@ const IntegrationMile = props => {
},
time
*
1000
);
};
const
onLink
=
(
item
,
loginA
)
=>
{
if
(
!
integrationData
[
item
.
name
])
{
message
.
warning
(
'当前账号没有权限,请联系管理人员配置'
);
return
;
}
const
{
url
,
client
}
=
item
;
if
(
!
url
&&
!
client
)
return
message
.
warning
(
'未配置功能路径'
);
if
(
url
)
{
...
...
@@ -222,7 +255,6 @@ const IntegrationMile = props => {
sessionStorage.setItem(currentProductNew, 0);
setMClient(client);
const config = props.global;
window.qiankunStarted = false;
if (client) {
config.client = client;
...
...
@@ -231,7 +263,7 @@ const IntegrationMile = props => {
const token = props.global?.token || Cookies.get('token');
if (!token) {
history.push(`
/
user
/
login
?
client
=
$
{
global
Client
}
`, { reload: true });
history.push(`
/
user
/
login
?
client
=
$
{
integration
Client
}
`, { reload: true });
clear();
props.logout();
} else {
...
...
@@ -280,6 +312,7 @@ const IntegrationMile = props => {
}
}
};
useEffect(() => {
getData();
window.addEventListener('resize', debounce(onResize, 300));
...
...
@@ -299,7 +332,7 @@ const IntegrationMile = props => {
timer4.current = null;
}
timer4.current = setTimeout(() => {
if ($('.CarouselRipples')) {
if ($('.CarouselRipples')
?.ripples
) {
$('.CarouselRipples').ripples({
resolution: 800,
dropRadius: 20, // px
...
...
@@ -400,17 +433,17 @@ const IntegrationMile = props => {
: null}
</div>
</div>
{
linkUrl &&
showBackBtn ? (
{showBackBtn ? (
<div
className={classNames(styles.iframeExit, 'animate__animated', 'animate__fadeIn')}
onClick={() =>
setLinkUrl(''
)}
onClick={() =>
props.logout(
)}
>
<div className={styles.iframeBackLeft}>
<img src={arrowLeftImg} alt="返回" />
</div>
<div className={styles.iframeExitIcon}>
<img src={backImg} alt="返回" />
返回
退出
</div>
</div>
) : null}
...
...
@@ -432,6 +465,9 @@ const mapDispatchToProps = dispatch => ({
updateCurrentIndex(index) {
dispatch(actionCreators.updateCurrentIndex(index));
},
logout() {
dispatch(actionCreators.logout());
},
});
export default connect(
mapStateToProps,
...
...
src/pages/bootpage/template/project/mile/index.less
View file @
7d920eea
...
...
@@ -8,12 +8,12 @@
.iframeExitIcon {
position: absolute;
top: 0;
lef
t: -45px;
righ
t: -45px;
display: flex;
height: 44px;
width: 44px;
background: rgba(28, 94, 180, 0.95);
border-radius:
0 7px 7px 0
;
border-radius:
7px 0px 0px 7px
;
flex-direction: column;
justify-content: space-around;
align-items: center;
...
...
@@ -30,11 +30,11 @@
.iframeExit:hover {
.iframeExitIcon {
lef
t: 0;
righ
t: 0;
}
.iframeBackLeft {
lef
t: -15px;
righ
t: -15px;
}
}
...
...
@@ -42,11 +42,11 @@
.iframeBackLeft {
position: absolute;
top: 0;
lef
t: 0;
righ
t: 0;
width: 14px;
height: 44px;
background: rgba(28, 94, 180, 0.95);
border-radius:
0 7px 7px 0
;
border-radius:
7px 0 0 7px
;
display: flex;
align-items: center;
justify-content: center;
...
...
@@ -62,8 +62,8 @@
width: 44px;
height: 44px;
position: absolute;
top:
4
px;
lef
t: 0;
top:
50
px;
righ
t: 0;
color: #FFF;
cursor: pointer;
user-select: none;
...
...
src/pages/integratedLogin/index.js
View file @
7d920eea
...
...
@@ -141,7 +141,7 @@ const IntegratedLogin = props => {
<
EditTwoTone
onClick
=
{()
=>
edit
(
record
)}
style
=
{{
fontSize
:
'16px'
}}
/
>
<
/Tooltip
>
{
!
record
.
isEnable
?
(
<
Tooltip
title
=
"
停
用"
>
<
Tooltip
title
=
"
点击启
用"
>
<
Popconfirm
placement
=
"left"
title
=
{
...
...
@@ -158,7 +158,7 @@ const IntegratedLogin = props => {
<
/Popconfirm
>
<
/Tooltip
>
)
:
(
<
Tooltip
title
=
"
启
用"
>
<
Tooltip
title
=
"
点击停
用"
>
<
Popconfirm
placement
=
"left"
title
=
{
...
...
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