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
71d18457
Commit
71d18457
authored
Jun 18, 2024
by
李纪文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 修改集成登录
parent
c5bd603a
Pipeline
#89926
waiting for manual action with stages
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
12 deletions
+62
-12
index.js
src/components/IntegratedSwitch/index.js
+15
-3
BasicLayout.js
src/layouts/BasicLayout.js
+2
-1
index.js
src/pages/bootpage/template/integration/index.js
+18
-6
AddModal.js
src/pages/integratedLogin/components/AddModal.js
+27
-2
No files found.
src/components/IntegratedSwitch/index.js
View file @
71d18457
...
...
@@ -48,7 +48,11 @@ const IntegratedSwitch = props => {
appService
.
getTicketByToken
({
token
:
window
.
globalConfig
?.
token
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
const
url
=
`
${
item
.
url
+
(
item
.
url
.
indexOf
(
'?'
)
>
0
?
'&'
:
'?'
)
+
item
.
paramName
}
=
${
res
.
data
}
`
;
window
.
open
(
url
,
'_blank'
);
if
(
item
?.
openOpt
===
'当前页打开'
)
{
history
.
push
(
'/thirdParty'
,
{
linkUrl
:
url
});
}
else
{
window
.
open
(
url
,
'_blank'
);
}
}
else
{
notification
.
error
({
message
:
'提示'
,
...
...
@@ -59,7 +63,11 @@ const IntegratedSwitch = props => {
});
}
else
{
const
url
=
`
${
item
.
url
+
(
item
.
url
.
indexOf
(
'?'
)
>
0
?
'&'
:
'?'
)
+
item
.
paramName
}
=
${
window
.
globalConfig
?.
token
}
`;
window.open(url, '_blank');
if (item?.openOpt === '当前页打开') {
history.push('/thirdParty', { linkUrl: url });
} else {
window.open(url, '_blank');
}
}
} else if (item.subType === '内链') {
if (window.qiankunIsCache) {
...
...
@@ -103,7 +111,11 @@ const IntegratedSwitch = props => {
dataType: 'json',
}).then(res => {
if (res?.data?.code === 0) {
history.push('/thirdParty', { linkUrl: res.data?.data });
if (item?.openOpt === '当前页打开') {
history.push('/thirdParty', { linkUrl: res.data?.data });
} else {
window.open(res.data?.data, '_blank');
}
}
});
}
...
...
src/layouts/BasicLayout.js
View file @
71d18457
...
...
@@ -744,7 +744,8 @@ const Layout = props => {
headerSiteRender={() =>
window?.globalConfig?.isIntegration >= 1
?
renderIntegration(integrationData, loginAction, props)
// renderIntegration(integrationData, loginAction, props)
null
:
renderSite({
data: cityData,
...
...
src/pages/bootpage/template/integration/index.js
View file @
71d18457
...
...
@@ -43,13 +43,17 @@ const Integration = props => {
},
0
);
},
3000
);
if
(
item
.
subType
==
'外链'
)
{
if
(
item
.
paramValue
==
'ticket'
)
{
if
(
item
.
subType
==
=
'外链'
)
{
if
(
item
.
paramValue
==
=
'ticket'
)
{
// 获取临时token
appService
.
getTicketByToken
({
token
:
window
.
globalConfig
?.
token
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
const
url
=
`
${
item
.
url
+
(
item
.
url
.
indexOf
(
'?'
)
>
0
?
'&'
:
'?'
)
+
item
.
paramName
}
=
${
res
.
data
}
`
;
window
.
open
(
url
,
'_blank'
);
if
(
item
?.
openOpt
===
'当前页打开'
)
{
props
.
history
.
push
(
'/thirdParty'
,
{
linkUrl
:
url
});
}
else
{
window
.
open
(
url
,
'_blank'
);
}
}
else
{
notification
.
error
({
message
:
'提示'
,
...
...
@@ -62,9 +66,13 @@ const Integration = props => {
const
url
=
`
${
item
.
url
+
(
item
.
url
.
indexOf
(
'?'
)
>
0
?
'&'
:
'?'
)
+
item
.
paramName
}
=
${
window
.
globalConfig
?.
token
}
`;
window.open(url, '_blank');
if (item?.openOpt === '当前页打开') {
props.history.push('/thirdParty', { linkUrl: url });
} else {
window.open(url, '_blank');
}
}
} else if (item.subType == '内链') {
} else if (item.subType ==
=
'内链') {
if (window.qiankunIsCache) {
store.set('event:dropCache');
}
...
...
@@ -108,7 +116,11 @@ const Integration = props => {
}).then(res => {
if (res?.data?.code === 0) {
// window.location.href = res.data?.data;
props.history.push('/thirdParty', { linkUrl: res.data?.data });
if (item?.openOpt === '当前页打开') {
props.history.push('/thirdParty', { linkUrl: res.data?.data });
} else {
window.open(res.data?.data, '_blank');
}
}
});
}
...
...
src/pages/integratedLogin/components/AddModal.js
View file @
71d18457
...
...
@@ -33,6 +33,7 @@ const AddModal = props => {
const
[
radio
,
setRadio
]
=
useState
();
const
[
identity
,
setIdentity
]
=
useState
(
0
);
const
[
form
]
=
Form
.
useForm
();
const
subTypes
=
Form
.
useWatch
(
'subType'
,
form
);
const
[
imageUrl
,
setImageUrl
]
=
useState
();
const
[
im
,
setIm
]
=
useState
();
const
[
previewModal
,
setPreviewModal
]
=
useState
(
false
);
...
...
@@ -60,7 +61,19 @@ const AddModal = props => {
setRadio
(
pickItem
.
target
!=
0
);
setIdentity
(
pickItem
.
siteType
);
setAccount
(
pickItem
.
accountType
);
const
{
paramName
,
paramValue
,
url
,
name
,
icon
,
roles
,
appKey
,
appSecret
,
whiteList
,
subType
}
=
pickItem
;
const
{
paramName
,
paramValue
,
url
,
name
,
icon
,
roles
,
appKey
,
appSecret
,
whiteList
,
subType
,
openOpt
=
''
,
}
=
pickItem
;
form
.
setFieldsValue
({
paramName
,
paramValue
,
...
...
@@ -72,6 +85,7 @@ const AddModal = props => {
appKey
,
appSecret
,
whiteList
,
openOpt
:
openOpt
||
''
,
});
if
(
pickItem
.
images
&&
pickItem
.
images
.
length
>
0
)
{
const
arr
=
[];
...
...
@@ -138,7 +152,8 @@ const AddModal = props => {
const
data
=
pickItem
.
roles
.
split
(
','
);
const
newData
=
[];
data
.
forEach
(
item
=>
{
newData
.
push
(
aa
.
角色
.
find
(
i
=>
i
.
value
==
item
).
label
);
const
list
=
aa
.
角色
.
find
(
i
=>
i
.
value
===
item
);
if
(
list
)
newData
.
push
(
list
.
label
);
});
form
.
setFieldsValue
({
roles
:
newData
.
toString
()
});
}
...
...
@@ -236,6 +251,7 @@ const AddModal = props => {
appSecret
:
obj
.
appSecret
,
whiteList
:
obj
.
whiteList
,
subType
:
obj
.
subType
,
openOpt
:
obj
.
openOpt
||
''
,
})
.
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
...
...
@@ -275,6 +291,7 @@ const AddModal = props => {
appKey
:
obj
.
appKey
,
appSecret
:
obj
.
appSecret
,
subType
:
obj
.
subType
,
openOpt
:
obj
.
openOpt
||
''
,
})
.
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
...
...
@@ -557,6 +574,14 @@ const AddModal = props => {
<
Radio
value
=
"自定义"
>
自定义
<
/Radio
>
<
/Radio.Group
>
<
/Item
>
{
subTypes
!==
'内链'
?
(
<
Item
label
=
"跳转方式"
name
=
"openOpt"
initialValue
=
"打开新链接"
>
<
Radio
.
Group
>
<
Radio
value
=
"新窗口打开"
>
新窗口打开
<
/Radio
>
<
Radio
value
=
"当前页打开"
>
当前页打开
<
/Radio
>
<
/Radio.Group
>
<
/Item
>
)
:
null
}
<
Item
label
=
"地址"
name
=
"url"
rules
=
{[{
required
:
true
,
message
:
'请输入站点路径'
}]}
>
<
AutoComplete
placeholder
=
"请输入可以访问的链接,需要与下方的链接类型对应"
allowClear
/>
<
/Item
>
...
...
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