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
3d11bbd9
Commit
3d11bbd9
authored
5 months ago
by
周宏民
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 修改集成登录配全局引用
parent
50759b3b
Pipeline
#93749
waiting for manual action with stages
Changes
12
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
90 additions
and
96 deletions
+90
-96
index.js
src/components/IntegratedSwitch/index.js
+18
-3
index.less
src/components/IntegratedSwitch/index.less
+4
-2
actions.js
src/containers/App/store/actions.js
+9
-0
constants.js
src/containers/App/store/constants.js
+1
-0
reducer.js
src/containers/App/store/reducer.js
+29
-23
BasicLayout.js
src/layouts/BasicLayout.js
+2
-0
index.js
src/pages/bootpage/index.js
+6
-9
index.js
src/pages/bootpage/template/integrationNew/index.js
+5
-1
index.js
src/pages/bootpage/template/project/qinzhou/index.js
+4
-1
AddModal.js
src/pages/integratedLogin/components/AddModal.js
+3
-55
Master.js
src/pages/integratedLogin/components/Master.js
+1
-1
index.js
src/pages/integratedLogin/index.js
+8
-1
No files found.
src/components/IntegratedSwitch/index.js
View file @
3d11bbd9
...
...
@@ -17,8 +17,17 @@ import LoadPage from '@/components/LoadPage';
import
{
getUserInfo
,
getWebSiteConfig
}
from
'@/api/service/base'
;
import
{
goToPath
,
searchUrl
}
from
'@/utils/utils'
;
import
styles
from
'./index.less'
;
const
tipStyleMap
=
{
左下
:
{
justifyContent
:
'flex-start'
,
},
// 中下:{},
右下
:
{
justifyContent
:
'flex-end'
,
},
};
const
IntegratedSwitch
=
props
=>
{
const
integratedConfig
=
props
.
integratedConfig
?.
toObject
?
props
.
integratedConfig
.
toObject
()
:
props
.
integratedConfig
||
{}
const
timer
=
useRef
(
null
);
const
timer3
=
useRef
(
null
);
const
progressRef
=
useRef
(
0
);
...
...
@@ -255,8 +264,13 @@ const IntegratedSwitch = props => {
};
}, [loginAction.events, props]);
return dataList.length > 1 ? (
<div className={styles.switchPage}>
return dataList.length > 1 && integratedConfig?.isShowTip !== '不显示' ? (
<div
className={styles.switchPage}
style={{
...tipStyleMap[(integratedConfig?.tipAlign)],
}}
>
{jumpLoading ? (
<div className={styles.integrationJumpLoad} key="jumpLoading">
<div style={{ width: '285px' }}>
...
...
@@ -301,6 +315,7 @@ const mapStateToProps = state => ({
global: state.getIn(['
global
', '
globalConfig
']),
instance: state.getIn(['
global
', '
instance
']),
client: state.getIn(['
global
', '
client
']),
integratedConfig: state.getIn(['
global
', '
integratedConfig
']),
});
const mapDispatchToProps = dispatch => ({
updateConfig(config) {
...
...
This diff is collapsed.
Click to expand it.
src/components/IntegratedSwitch/index.less
View file @
3d11bbd9
.switchPage {
position:
fixed
;
position:
absolute
;
bottom: 0;
left: 0;
z-index: 1200;
...
...
@@ -8,6 +8,7 @@
justify-content: center;
width: 100%;
height: 0px;
padding: 0 10px;
.integrationJumpLoad {
width: 100vw;
...
...
@@ -33,6 +34,7 @@
border-radius: 14px;
overflow: hidden;
height: 8px;
min-width: 80px;
// width: 80px;
width: auto;
background: rgba(94, 121, 143, .65);
...
...
@@ -52,7 +54,7 @@
}
.switchPageLi {
padding: 10px;
padding: 10px
5px
;
// display: none;
display: flex;
height: 100%;
...
...
This diff is collapsed.
Click to expand it.
src/containers/App/store/actions.js
View file @
3d11bbd9
...
...
@@ -25,6 +25,7 @@ import {
MAP_VIEW
,
AMAP_VIEW
,
PD_VIEW
,
CONFIG_INTEGRATED
,
}
from
'./constants'
;
export
function
getConfig
(
data
)
{
return
{
...
...
@@ -185,6 +186,13 @@ export function updatePdCesiumView(data) {
};
}
export
function
updateIntegratedConfig
(
data
)
{
return
{
type
:
CONFIG_INTEGRATED
,
data
,
};
}
export
function
logout
(
data
)
{
// eslint-disable-next-line no-undef
createStoreage
.
remove
(
'PANDA_STORE'
);
...
...
@@ -230,6 +238,7 @@ export function logout(data) {
}
localStorage
.
removeItem
(
'integrationClient'
);
localStorage
.
removeItem
(
'integrationData'
);
localStorage
.
removeItem
(
'integrationConfig'
);
localStorage
.
removeItem
(
'access_token'
);
localStorage
.
removeItem
(
'password_token'
);
localStorage
.
removeItem
(
'password_pwdRegex'
);
...
...
This diff is collapsed.
Click to expand it.
src/containers/App/store/constants.js
View file @
3d11bbd9
...
...
@@ -22,3 +22,4 @@ export const LOGINOUT = 'App/LOGINOUT';
export
const
MAP_VIEW
=
'App/MAP_VIEW'
;
export
const
AMAP_VIEW
=
'App/AMAP_VIEW'
;
export
const
PD_VIEW
=
'App/PD_VIEW'
;
export
const
CONFIG_INTEGRATED
=
'App/CONFIG_INTEGRATED'
;
This diff is collapsed.
Click to expand it.
src/containers/App/store/reducer.js
View file @
3d11bbd9
...
...
@@ -33,6 +33,7 @@ import {
MAP_VIEW
,
AMAP_VIEW
,
PD_VIEW
,
CONFIG_INTEGRATED
,
}
from
'./constants'
;
const
{
generMainRoutes
,
generFlatRoutes
,
transformWidgets
}
=
helpers
;
...
...
@@ -73,6 +74,7 @@ export const initialState = fromJS({
microMounted
:
true
,
mapView
:
null
,
amapView
:
{},
integratedConfig
:
JSON
.
parse
(
localStorage
.
getItem
(
'integrationConfig'
)
||
'{}'
),
});
/* eslint-disable default-case, no-param-reassign */
...
...
@@ -80,24 +82,19 @@ const appReducer = (state = initialState, action) => {
switch
(
action
.
type
)
{
case
GET_CONFIG
:
/* eslint-disable */
window
.
__INITIAL_STATE__
=
Object
.
assign
(
{},
action
.
data
,
{
window
.
__INITIAL_STATE__
=
Object
.
assign
({},
action
.
data
,
{
assetsRoot
:
proxy
.
assetsRoot
,
allWidgets
:
action
.
data
.
widgets
||
[],
env
:
process
.
env
.
NODE_ENV
===
'development'
?
'daily'
:
'prod'
,
},
);
});
window
.
arcgisAssetsPath
=
`
${
window
.
location
.
origin
}
/
${
pkg
.
name
.
toLocaleLowerCase
()}
/assets`
;
window
.
__INITIAL_STATE__
.
mdi
=
'SDI'
;
window
.
__INITIAL_STATE__
.
menu
=
'banner-left'
;
const
temp
=
AppConfig
(
window
.
__INITIAL_STATE__
)
temp
.
displayMode
=
window
.
__INITIAL_STATE__
?.
displayMode
||
''
const
temp
=
AppConfig
(
window
.
__INITIAL_STATE__
);
temp
.
displayMode
=
window
.
__INITIAL_STATE__
?.
displayMode
||
''
;
temp
.
isVerification
=
action
.
data
.
isVerification
||
''
;
window
.
globalConfig
=
temp
;
// eslint-disable-next-line no-undef
createStoreage
.
set
(
'globalConfig'
,
window
.
globalConfig
);
// eslint-disable-next-line no-undef,no-case-declarations
...
...
@@ -106,7 +103,10 @@ const appReducer = (state = initialState, action) => {
// eslint-disable-next-line no-case-declarations
const
{
homepage
,
isOpenTransitionPage
}
=
window
.
globalConfig
;
const
modulePkg
=
{};
window
.
globalConfig
&&
window
.
globalConfig
.
products
&&
Array
.
isArray
(
window
.
globalConfig
.
products
)
&&
window
.
globalConfig
.
products
.
map
(
item
=>
{
window
.
globalConfig
&&
window
.
globalConfig
.
products
&&
Array
.
isArray
(
window
.
globalConfig
.
products
)
&&
window
.
globalConfig
.
products
.
map
(
item
=>
{
modulePkg
[
item
.
PackageName
]
=
item
;
});
config
.
widgets
=
transformWidgets
(
config
.
widgets
);
...
...
@@ -116,14 +116,16 @@ const appReducer = (state = initialState, action) => {
if
(
generMenu
)
{
const
flat
=
state
.
toJS
();
const
data
=
_
.
uniqBy
(
generFlatRoutes
(
generMenu
||
[],
null
,
null
,
modulePkg
),
'path'
);
if
(
_
.
isEqualWith
(
flat
.
flatMenu
,
data
,
(
value
,
other
)
=>
{
if
(
_
.
isEqualWith
(
flat
.
flatMenu
,
data
,
(
value
,
other
)
=>
{
if
(
value
.
path
===
other
.
path
)
{
return
true
return
true
;
}
}))
{
flatMenu
=
data
})
)
{
flatMenu
=
data
;
}
else
{
flatMenu
=
flat
.
flatMenu
flatMenu
=
flat
.
flatMenu
;
}
const
index
=
flatMenu
.
findIndex
(
item
=>
item
.
name
===
'首页'
);
if
(
!
isOpenTransitionPage
&&
index
===
-
1
)
{
...
...
@@ -131,8 +133,8 @@ const appReducer = (state = initialState, action) => {
path
:
`/
${
homepage
}
`
,
href
:
`/
${
homepage
}
`
,
key
:
'PANDA_HOME'
,
name
:
'首页'
})
name
:
'首页'
,
})
;
}
}
...
...
@@ -145,14 +147,12 @@ const appReducer = (state = initialState, action) => {
return
currentPath
===
decodeURI
(
homepage
);
});
let
currentMenuIndex
=
0
;
if
(
home
)
{
const
parent
=
home
.
level
>=
2
?
home
.
parent
.
parent
:
home
.
level
>=
3
?
home
.
parent
.
parent
.
parent
:
home
.
parent
;
if
(
parent
)
{
currentMenuIndex
=
generMenu
.
findIndex
(
item
=>
item
.
name
===
parent
.
label
)
||
0
;
sessionStorage
.
setItem
(
currentProduct
,
currentMenuIndex
)
sessionStorage
.
setItem
(
currentProduct
,
currentMenuIndex
)
;
store
.
set
(
'updateMenuIndex'
,
currentMenuIndex
);
}
}
...
...
@@ -208,8 +208,10 @@ const appReducer = (state = initialState, action) => {
recentVisited
:
[],
});
case
GET_CURRENT_INDEX
:
const
currentProductNew
=
`__global__recent_productIndex__micro_
${
window
.
location
.
hostname
}
_
${
sessionStorage
.
getItem
(
'client'
)
||
window
.
globalConfig
?.
client
||
'city'
}
`;
sessionStorage.setItem(currentProductNew, action.data)
const
currentProductNew
=
`__global__recent_productIndex__micro_
${
window
.
location
.
hostname
}
_
${
sessionStorage
.
getItem
(
'client'
)
||
window
.
globalConfig
?.
client
||
'city'
}
`;
sessionStorage.setItem(currentProductNew, action.data);
return state.merge({
currentMenuIndex: Number(sessionStorage.getItem(currentProductNew)) || 0,
});
...
...
@@ -271,7 +273,11 @@ const appReducer = (state = initialState, action) => {
return state.merge({
pdView: action.data,
});
case CONFIG_INTEGRATED:
localStorage.setItem('integrationConfig',action.data ? JSON.stringify(action.data) : '');
return state.merge({
integratedConfig: fromJS(action.data || {})
});
default:
return state;
}
...
...
This diff is collapsed.
Click to expand it.
src/layouts/BasicLayout.js
View file @
3d11bbd9
...
...
@@ -266,6 +266,7 @@ const Layout = props => {
)
||
sessionStorage
.
getItem
(
'client'
)
||
'city'
}
`
;
const
integratedConfig
=
props
.
integratedConfig
?.
toObject
?
props
.
integratedConfig
.
toObject
()
:
props
.
integratedConfig
||
{}
const
menuState
=
sessionStorage
.
getItem
(
'menuState'
)
||
'open'
;
const
[
cityData
,
setCityData
]
=
useState
({});
const
[
siteLoading
,
setSiteLoading
]
=
useState
(
false
);
...
...
@@ -822,6 +823,7 @@ const mapStateToProps = state => ({
flatMenu: state.getIn(['global', 'flatMenu']),
instance: state.getIn(['global', 'instance']),
currentMenuIndex: state.getIn(['global', 'currentMenuIndex']),
integratedConfig: state.getIn(['global', 'integratedConfig'])
});
const mapDispatchToProps = dispatch => ({
updageSetting(setting) {
...
...
This diff is collapsed.
Click to expand it.
src/pages/bootpage/index.js
View file @
3d11bbd9
...
...
@@ -22,7 +22,6 @@ const BootPage = props => {
loading
:
true
,
error
:
false
,
});
const
integratedConfig
=
useRef
({});
const
{
clear
}
=
useAliveController
();
const
history
=
useHistory
();
const
[
template
,
setTemplate
]
=
useState
(
window
?.
globalConfig
?.
displayMode
||
'default'
);
...
...
@@ -57,28 +56,23 @@ const BootPage = props => {
setInfo
({
first
:
false
,
loading
:
false
,
error
:
true
});
return
;
}
integratedConfig
.
current
=
data
;
let
displayMode
=
data
?.
displayMode
||
'default'
;
if
(
displayMode
===
'卡片'
||
displayMode
===
'地图'
)
{
displayMode
=
'default'
;
}
props
.
updateIntegratedConfig
(
data
||
''
);
setTemplate
(
displayMode
);
setInfo
({
first
:
false
,
loading
:
false
,
error
:
false
});
})
.
catch
(
err
=>
{
setInfo
({
first
:
false
,
loading
:
false
,
error
:
true
});
props
.
updateIntegratedConfig
(
''
);
});
},
[]);
return
(
<
SecurityLayout
>
{
info
.
loading
?
(
<
Spin
/>
)
:
info
.
error
?
(
<
Empty
/>
)
:
(
<
RenderComponent
{...{
...
props
,
...{
integratedConfig
:
integratedConfig
.
current
}
}}
/
>
)}
{
info
.
loading
?
<
Spin
/>
:
info
.
error
?
<
Empty
/>
:
<
RenderComponent
{...{
...
props
}}
/>
}
<
/SecurityLayout
>
);
};
...
...
@@ -90,6 +84,9 @@ const mapDispatchToProps = dispatch => ({
logout
()
{
dispatch
(
actionCreators
.
logout
());
},
updateIntegratedConfig
(
data
)
{
dispatch
(
actionCreators
.
updateIntegratedConfig
(
data
));
},
});
export
default
connect
(
mapStateToProps
,
...
...
This diff is collapsed.
Click to expand it.
src/pages/bootpage/template/integrationNew/index.js
View file @
3d11bbd9
...
...
@@ -33,7 +33,10 @@ const boxWidth = 1920;
const
boxHeight
=
930
;
const
IntegrationNew
=
props
=>
{
const
{
integratedConfig
}
=
props
;
const
integratedConfig
=
props
.
integratedConfig
?.
toObject
?
props
.
integratedConfig
.
toObject
()
:
props
.
integratedConfig
||
{};
const
[
ref
,
isFullscreen
,
handleFullScreen
,
handleExitFullScreen
]
=
useFullScreen
(
false
);
const
history
=
useHistory
();
const
integrationClient
=
integratedConfig
?.
client
||
window
?.
globalConfig
?.
client
||
'city'
;
// 集成登录client
...
...
@@ -450,6 +453,7 @@ const IntegrationNew = props => {
};
const mapStateToProps = state => ({
global: state.getIn(['global', 'globalConfig']),
integratedConfig: state.getIn(['global', 'integratedConfig']),
});
const mapDispatchToProps = dispatch => ({
updateConfig(config) {
...
...
This diff is collapsed.
Click to expand it.
src/pages/bootpage/template/project/qinzhou/index.js
View file @
3d11bbd9
...
...
@@ -27,7 +27,9 @@ import Iframe from '../../demonstration/components/Iframe';
const
boxWidth
=
1920
;
const
boxHeight
=
930
;
const
IntegrationQinzhou
=
props
=>
{
const
{
integratedConfig
}
=
props
;
const
integratedConfig
=
props
.
integratedConfig
?.
toObject
?
props
.
integratedConfig
.
toObject
()
:
props
.
integratedConfig
||
{};
const
[
ref
,
isFullscreen
,
handleFullScreen
,
handleExitFullScreen
]
=
useFullScreen
(
false
);
const
clientRef
=
useRef
(
props
.
global
.
client
);
...
...
@@ -508,6 +510,7 @@ const IntegrationQinzhou = props => {
};
const mapStateToProps = state => ({
global: state.getIn(['global', 'globalConfig']),
integratedConfig: state.getIn(['global', 'integratedConfig']),
});
const mapDispatchToProps = dispatch => ({
updateConfig(config) {
...
...
This diff is collapsed.
Click to expand it.
src/pages/integratedLogin/components/AddModal.js
View file @
3d11bbd9
...
...
@@ -614,36 +614,6 @@ const AddModal = props => {
<
/Item
>
<
/Col
>
<
/Row
>
{
/* <Item
label="AppKey"
name="appKey"
className={styles.disabledInput}
// rules={[{ required: true, message: '请输入参数' }]}
>
<Input placeholder="请输入自定义的AppKey," />
</Item> */
}
{
/* <Item
label="AppSecret"
name="appSecret"
className={styles.disabledInput}
// rules={[{ required: true, message: '请输入AppKey,或点击刷新按钮重新获取AppSecret' }]}
>
<Input
disabled
placeholder="请点击按钮生成AppSecret"
suffix={
<Tooltip title="点击按钮重新生成AppSecret">
<RedoOutlined
style={{ fontSize: 'bold', color: 'rgba(25,128,255,0.74)' }}
onClick={refreshAppSecret}
/>
</Tooltip>
}
/>
</Item> */
}
{
/* <Item label="白名单" name="whiteList">
<TextArea rows={3} />
</Item> */
}
<
/
>
)
:
(
<>
...
...
@@ -651,37 +621,15 @@ const AddModal = props => {
<
Input
placeholder
=
"请输入网站client"
/>
<
/Item
>
<
Item
label
=
"
地址
"
label
=
"
功能路径
"
name
=
"url"
tooltip
=
{{
title
:
'默认访问功能地址,不填则默认跳转当前网站首页'
,
title
:
'默认访问功能地址,
地址为运维配置的功能路径,
不填则默认跳转当前网站首页'
,
icon
:
<
InfoCircleOutlined
/>
,
}}
>
<
AutoComplete
placeholder
=
"请输入默认访问功能
地址
"
allowClear
/>
<
AutoComplete
placeholder
=
"请输入默认访问功能
路径
"
allowClear
/>
<
/Item
>
{
/* <Item
label="client"
name="appKey"
className={styles.disabledInput}
tooltip={{
title: '对应网站client',
icon: <InfoCircleOutlined />,
}}
rules={[{ required: true, message: '请输入参数' }]}
>
<Input placeholder="请输入网站client" />
</Item> */
}
{
/* <Item
label="地址"
name="url"
tooltip={{
title: '默认访问功能地址,不填则默认跳转当前网站首页',
icon: <InfoCircleOutlined />,
}}
>
<AutoComplete placeholder="请输入默认访问功能地址" allowClear />
</Item> */
}
<
/
>
)}
<
Item
...
...
This diff is collapsed.
Click to expand it.
src/pages/integratedLogin/components/Master.js
View file @
3d11bbd9
...
...
@@ -88,7 +88,7 @@ const Master = props => {
tipAlign
:
obj
.
tipAlign
,
},
};
if
(
isShowTip
!==
'直排'
||
isShowTip
!==
'转盘'
)
{
if
(
isShowTip
!==
'直排'
&&
isShowTip
!==
'转盘'
)
{
params
.
tipAlign
=
settingRef
.
current
.
tipAlign
||
'中下'
;
}
appService
...
...
This diff is collapsed.
Click to expand it.
src/pages/integratedLogin/index.js
View file @
3d11bbd9
...
...
@@ -397,7 +397,10 @@ const IntegratedLogin = props => {
add
(
e
.
key
);
};
const
onMasterBack
=
data
=>
{
if
(
data
)
configSetting
.
current
=
data
;
if
(
data
)
{
configSetting
.
current
=
data
;
props
.
updateIntegratedConfig
(
data
);
}
};
const
getConfigData
=
()
=>
{
appService
...
...
@@ -425,6 +428,7 @@ const IntegratedLogin = props => {
.
GetIntegratedloginSetting
()
.
then
(
res
=>
{
configSetting
.
current
=
res
.
data
||
{};
getData
();
getConfigData
();
})
...
...
@@ -529,6 +533,9 @@ const mapDispatchToProps = dispatch => ({
updateConfig(config) {
dispatch(actionCreators.getConfig(config));
},
updateIntegratedConfig(data) {
dispatch(actionCreators.updateIntegratedConfig(data));
},
});
export default connect(
mapStateToProps,
...
...
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