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
00db07f4
Commit
00db07f4
authored
Sep 12, 2023
by
徐乐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 修改
parent
8703dbfb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
72 deletions
+39
-72
BasicLayout.js
src/layouts/BasicLayout.js
+21
-71
index.js
src/pages/bootpage/integration/index.js
+18
-1
No files found.
src/layouts/BasicLayout.js
View file @
00db07f4
...
...
@@ -227,76 +227,6 @@ const renderSite = ({ data, config, loading, setLoading, action, actionRef, setM
);
};
// const renderIntegration = (inData, loginAction, props) => {
// const [visible, setVisible] = useState(false);
// if (inData.length <= 1) {
// return <></>
// }
// let choiceOne = inData?.find(function (a) {
// return a.url?.indexOf(window?.globalConfig?.client) >= 0
// })
// //切换集成站点
// const checkIntegration = (val, loginAction, props) => {
// if (val.subType == '外链') {
// window.open(val.url, "_blank");
// } else {
// let cli = val.url?.indexOf('client=') >= 0 ? val.url.split('client=')[1] : '';
// const config = props.global;
// config.uiwidgets = [];
// config.widgets = [];
// config.allWidgets = [];
// if (cli) {
// config.client = cli;
// }
// props.instance && props.instance.updateConfig(config);
// loginAction && loginAction.getUserInfoAndConfig('', true, val.type, cli);
// // props.history.push(`/?client=${cli}`);
// // props.updateCurrentIndex(0);
// // defaultApp();
// }
// }
// return (
// <>
// <Popover
// placement="bottomLeft"
// trigger="click"
// visible={visible}
// content={
// <div className={layoutStyles.integrationList}>
// {
// inData && inData.map((val) => (
// <p onClick={() => checkIntegration(val, loginAction, props)}>{val.name}</p>
// ))
// }
// </div>
// }
// arrowPointAtCenter
// overlayClassName={classNames(layoutStyles.stationsWrapper, layoutStyles.stationsTop2)}
// onVisibleChange={visible => setVisible(visible)}
// >
// {inData.length > 1 ? (
// <div className={layoutStyles.toggleSite}>
// <img src={require('../assets/basic/site.png')} className={layoutStyles.site} />
// <span className={layoutStyles.name}>{choiceOne?.name ?? ''}</span>
// <ArrowIcon
// className={layoutStyles.arrow}
// style={{
// transform: !visible ? `rotate(0deg)` : `rotate(180deg)`,
// }}
// />
// </div>
// ) : null}
// </Popover>
// </>
// )
// }
// import defaultProps from '../defaultProps';
const
pickRoutes
=
memoized
((
routes
,
pathname
,
locale
)
=>
{
const
matches
=
matchRoutes
(
routes
,
{
pathname
});
...
...
@@ -561,7 +491,27 @@ const Layout = props => {
//切换集成站点
const
checkIntegration
=
(
val
,
loginAction
,
props
)
=>
{
if
(
val
.
subType
==
'外链'
)
{
window
.
open
(
val
.
url
,
"_blank"
);
if
(
val
.
paramValue
==
'ticket'
)
{
//获取临时token
appService
.
getTicketByToken
({
token
:
window
.
globalConfig
?.
token
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
setVisible
(
false
);
let
url
=
val
.
url
+
(
val
.
url
.
indexOf
(
'?'
)
>
0
?
'&'
:
'?'
)
+
val
.
paramName
+
'='
+
res
.
data
;
window
.
open
(
url
,
"_blank"
);
}
else
{
setVisible
(
false
);
notification
.
error
({
message
:
'提示'
,
duration
:
3
,
description
:
res
.
msg
,
});
}
});
}
else
{
setVisible
(
false
);
let
url
=
val
.
url
+
(
val
.
url
.
indexOf
(
'?'
)
>
0
?
'&'
:
'?'
)
+
val
.
paramName
+
'='
+
window
.
globalConfig
?.
token
;
window
.
open
(
url
,
"_blank"
);
}
}
else
{
let
cli
=
val
.
url
?.
indexOf
(
'client='
)
>=
0
?
val
.
url
.
split
(
'client='
)[
1
]
:
''
;
setIntegrationLoading
(
true
);
...
...
src/pages/bootpage/integration/index.js
View file @
00db07f4
...
...
@@ -41,7 +41,24 @@ const Integration = props => {
},
3000
);
if
(
item
.
subType
==
'外链'
)
{
window
.
open
(
item
.
url
,
"_blank"
);
if
(
item
.
paramValue
==
'ticket'
)
{
//获取临时token
appService
.
getTicketByToken
({
token
:
window
.
globalConfig
?.
token
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
let
url
=
item
.
url
+
(
item
.
url
.
indexOf
(
'?'
)
>
0
?
'&'
:
'?'
)
+
item
.
paramName
+
'='
+
res
.
data
;
window
.
open
(
url
,
"_blank"
);
}
else
{
notification
.
error
({
message
:
'提示'
,
duration
:
3
,
description
:
res
.
msg
,
});
}
});
}
else
{
let
url
=
item
.
url
+
(
item
.
url
.
indexOf
(
'?'
)
>
0
?
'&'
:
'?'
)
+
item
.
paramName
+
'='
+
window
.
globalConfig
?.
token
;
window
.
open
(
url
,
"_blank"
);
}
}
else
{
let
cli
=
item
.
url
?.
indexOf
(
'client='
)
>=
0
?
item
.
url
.
split
(
'client='
)[
1
]
:
''
;
setClient
(
cli
);
...
...
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