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
fa6eb9e9
Commit
fa6eb9e9
authored
Nov 05, 2024
by
周宏民
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pref: 修改 集成登录配置
parent
d2045d42
Pipeline
#93665
passed with stages
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
116 additions
and
62 deletions
+116
-62
index.js
src/pages/bootpage/template/integrationNew/index.js
+7
-3
AddModal.js
src/pages/integratedLogin/components/AddModal.js
+88
-46
index.js
src/pages/integratedLogin/index.js
+21
-13
No files found.
src/pages/bootpage/template/integrationNew/index.js
View file @
fa6eb9e9
...
...
@@ -162,6 +162,8 @@ const IntegrationNew = props => {
if
(
item
?.
openOpt
===
'当前页打开'
)
{
props
.
history
.
push
(
'/thirdParty'
,
{
linkUrl
:
apiPath
});
}
else
{
setJumpLoading
(
false
);
jumpProgressEnd
();
window
.
open
(
apiPath
,
'_blank'
);
}
}
else
{
...
...
@@ -178,7 +180,7 @@ const IntegrationNew = props => {
const
toClient
=
async
(
item
,
loginA
)
=>
{
const
token
=
props
.
global
?.
token
||
Cookies
.
get
(
'token'
);
const
cli
=
item
.
appKey
;
const
cli
=
item
.
client
;
const
res
=
await
getWebSiteConfig
({
identity
:
token
,
client
:
cli
,
...
...
@@ -229,9 +231,9 @@ const IntegrationNew = props => {
props.logout();
return;
}
const { url,
appKey
} = item;
const { url,
client
} = item;
if (item.subType === '内链' &&
appKey
) {
if (item.subType === '内链' &&
client
) {
toClient(item, loginA);
} else {
if (!url) return;
...
...
@@ -247,6 +249,8 @@ const IntegrationNew = props => {
if (item?.openOpt === '当前页打开') {
props.history.push('/thirdParty', { linkUrl: link });
} else {
setJumpLoading(false);
jumpProgressEnd();
window.open(link, '_blank');
}
}
...
...
src/pages/integratedLogin/components/AddModal.js
View file @
fa6eb9e9
...
...
@@ -37,7 +37,6 @@ const AddModal = props => {
const
[
imageType
,
setImageType
]
=
useState
(
''
);
const
[
previewModal
,
setPreviewModal
]
=
useState
(
false
);
const
[
keepImgeUrl
,
setKeepImgeUrl
]
=
useState
(
''
);
const
[
fileList
,
setFileList
]
=
useState
([]);
const
[
isVisibleRoles
,
setIsVisibleRoles
]
=
useState
(
false
);
const
[
groupName
,
setGroupName
]
=
useState
(
'角色'
);
const
[
chooseGroupName
,
setChooseGroupName
]
=
useState
([
'角色'
]);
...
...
@@ -83,20 +82,6 @@ const AddModal = props => {
setLoading
(
true
);
const
obj
=
form
.
getFieldsValue
();
let
data
=
[];
if
(
obj
.
coordinate
)
{
data
=
obj
.
coordinate
.
split
(
','
);
}
const
dataList
=
[];
if
(
fileList
.
length
>
0
)
{
fileList
.
map
(
i
=>
{
if
(
i
.
submitUrl
)
{
dataList
.
push
(
i
.
submitUrl
);
}
else
{
dataList
.
push
(
i
.
response
.
data
);
}
});
}
if
(
!
imageUrl
)
{
message
.
error
(
'请选择图标!'
);
return
;
...
...
@@ -107,7 +92,7 @@ const AddModal = props => {
.
SaveIntegrationConfig
({
name
:
obj
.
name
,
type
:
targetType
,
url
:
obj
.
url
,
url
:
obj
.
url
||
''
,
roles
:
keepIds
?.
join
(
','
)
||
''
,
icon
:
imageUrl
,
userId
:
window
.
globalConfig
.
userInfo
.
OID
,
...
...
@@ -120,6 +105,7 @@ const AddModal = props => {
openOpt
:
obj
.
openOpt
||
''
,
backgroundImage
:
imageBgUrl
,
subTitle
:
obj
.
subTitle
||
''
,
client
:
obj
.
client
||
''
,
})
.
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
...
...
@@ -149,7 +135,7 @@ const AddModal = props => {
id
:
pickItem
.
id
,
name
:
obj
.
name
,
type
:
pickItem
.
type
,
url
:
obj
.
url
,
url
:
obj
.
url
||
''
,
roles
:
keepIds
===
null
?
pickItem
.
roles
:
keepIds
.
join
(
','
),
icon
:
imageUrl
,
userId
:
window
.
globalConfig
.
userInfo
.
OID
,
...
...
@@ -162,6 +148,7 @@ const AddModal = props => {
openOpt
:
obj
.
openOpt
||
''
,
backgroundImage
:
imageBgUrl
,
subTitle
:
obj
.
subTitle
||
''
,
client
:
obj
.
client
||
''
,
})
.
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
...
...
@@ -270,7 +257,11 @@ const AddModal = props => {
setKeepImgeUrl
(
img
);
setPreviewModal
(
true
);
};
const
onChangeSubType
=
e
=>
{
if
(
e
.
target
.
value
===
'外链'
)
{
form
.
setFieldsValue
({
openOpt
:
pickItem
.
openOpt
||
'当前页打开'
});
}
};
const
onOkImg
=
val
=>
{
if
(
val
)
{
if
(
imageType
===
'backgroundImage'
)
{
...
...
@@ -347,6 +338,7 @@ const AddModal = props => {
openOpt
=
''
,
backgroundImage
,
subTitle
,
client
,
}
=
pickItem
;
form
.
setFieldsValue
({
paramName
,
...
...
@@ -362,12 +354,13 @@ const AddModal = props => {
openOpt
:
openOpt
||
''
,
backgroundImage
,
subTitle
,
client
,
});
setImageUrl
(
icon
||
''
);
setImageBgUrl
(
backgroundImage
||
''
);
}
else
{
form
.
setFieldsValue
({
paramValue
:
'
ticket
'
,
paramValue
:
''
,
target
:
0
,
mapSetting
:
''
,
coordinate
:
''
,
...
...
@@ -376,7 +369,6 @@ const AddModal = props => {
});
}
}
else
{
setFileList
([]);
setImageUrl
(
''
);
setKeepImgeUrl
(
''
);
form
.
resetFields
();
...
...
@@ -545,20 +537,30 @@ const AddModal = props => {
<
/Item
>
<
/Col
>
<
/Row
>
<
Item
label
=
"链接类型"
name
=
"subType"
initialValue
=
"内链"
>
<
Radio
.
Group
>
<
Item
label
=
"链接类型"
name
=
"subType"
initialValue
=
"内链"
rules
=
{[{
required
:
true
,
message
:
'请选择链接类型'
}]}
>
<
Radio
.
Group
onChange
=
{
onChangeSubType
}
>
<
Radio
value
=
"内链"
>
站内跳转
<
/Radio
>
<
Radio
value
=
"外链"
>
站外跳转
<
/Radio
>
<
Radio
value
=
"自定义"
>
自定义
<
/Radio
>
{
/* <Radio value="自定义">自定义</Radio> */
}
<
/Radio.Group
>
<
/Item
>
{
subTypes
!==
'内链'
?
(
<>
{
' '
}
<
Item
label
=
"跳转方式"
name
=
"openOpt"
initialValue
=
"打开新链接"
>
<
Item
label
=
"跳转方式"
name
=
"openOpt"
initialValue
=
"打开新链接"
rules
=
{[{
required
:
true
,
message
:
'请选择打开新链接'
}]}
>
<
Radio
.
Group
>
<
Radio
value
=
"新窗口打开"
>
新窗口打开
<
/Radio
>
<
Radio
value
=
"当前页打开"
>
当前页打开
<
/Radio
>
<
Radio
value
=
"新窗口打开"
>
新窗口打开
<
/Radio
>
<
/Radio.Group
>
<
/Item
>
<
Item
label
=
"地址"
name
=
"url"
rules
=
{[{
required
:
true
,
message
:
'请输入站点路径'
}]}
>
...
...
@@ -570,35 +572,38 @@ const AddModal = props => {
labelCol
=
{{
span
:
8
}}
label
=
"参数名"
name
=
"paramName"
tooltip
=
{{
title
:
'直接跳转,不需要填该参数,若与每三方对接,需要该参数'
,
icon
:
<
InfoCircleOutlined
/>
,
}}
// rules={[{ required: true, message: '请输入参数' }]}
>
<
Input
allowClear
placeholder
=
"请填写站点参数"
/>
<
/Item
>
<
/Col
>
<
Col
span
=
{
10
}
>
<
Item
label
=
"参数值"
labelCol
=
{{
span
:
7
}}
name
=
"paramValue"
>
<
Item
label
=
"参数值"
labelCol
=
{{
span
:
7
}}
name
=
"paramValue"
tooltip
=
{{
title
:
'直接跳转,不需要填该参数,若与第三方对接,需要该参数,若跳转捷普营收,请选择ticket'
,
icon
:
<
InfoCircleOutlined
/>
,
}}
>
<
Select
placeholder
=
"请选择参数值"
>
<
Option
value
=
"ticket"
>
ticket
<
/Option
>
<
Option
value
=
"ticket"
/
>
<
Option
value
=
"token"
>
token
<
/Option
>
<
/Select
>
<
/Item
>
<
/Col
>
<
/Row
>
{
<>
<
Item
{
/* <Item
label="AppKey"
name="appKey"
className={styles.disabledInput}
// rules={[{ required: true, message: '请输入参数' }]}
>
<
Input
disabled
=
{
type
===
'edit'
}
placeholder
=
"请输入自定义的AppKey,提交后不可变更
"
/>
<
/Item
>
<
Item
<Input placeholder="请输入自定义的AppKey,
" />
</Item> */
}
{
/*
<Item
label="AppSecret"
name="appSecret"
className={styles.disabledInput}
...
...
@@ -616,23 +621,60 @@ const AddModal = props => {
</Tooltip>
}
/>
<
/Item
>
<
/
>
}
<
Item
label
=
"白名单"
name
=
"whiteList"
>
</Item> */
}
{
/* <Item label="白名单" name="whiteList">
<TextArea rows={3} />
<
/Item
>
</Item>
*/
}
<
/
>
)
:
(
<>
<
Item
label
=
"client"
name
=
"client"
rules
=
{[{
required
:
true
,
message
:
'请输入网站client'
}]}
>
<
Input
placeholder
=
"请输入网站client"
/>
<
/Item
>
<
Item
label
=
"AppKey"
label
=
"地址"
name
=
"url"
tooltip
=
{{
title
:
'默认访问功能地址,不填则默认跳转当前网站首页'
,
icon
:
<
InfoCircleOutlined
/>
,
}}
>
<
AutoComplete
placeholder
=
"请输入默认访问功能地址"
allowClear
/>
<
/Item
>
{
/* <Item
label="client"
name="appKey"
className={styles.disabledInput}
tooltip={{
title: '对应网站client',
icon: <InfoCircleOutlined />,
}}
rules={[{ required: true, message: '请输入参数' }]}
>
<
Input
disabled
=
{
type
===
'edit'
}
placeholder
=
"请输入网站client,提交后不可变更"
/>
<
/Item
>
<Input placeholder="请输入网站client" />
</Item> */
}
{
/* <Item
label="地址"
name="url"
tooltip={{
title: '默认访问功能地址,不填则默认跳转当前网站首页',
icon: <InfoCircleOutlined />,
}}
>
<AutoComplete placeholder="请输入默认访问功能地址" allowClear />
</Item> */
}
<
/
>
)}
<
Item
label
=
"AppKey"
name
=
"appKey"
tooltip
=
{{
title
:
'自定义集成登录页中,对应关系使用'
,
icon
:
<
InfoCircleOutlined
/>
,
}}
>
<
Input
placeholder
=
"请输入"
/>
<
/Item
>
<
/Form
>
<
PreviewModal
visible
=
{
previewModal
}
...
...
src/pages/integratedLogin/index.js
View file @
fa6eb9e9
...
...
@@ -76,7 +76,7 @@ const IntegratedLogin = props => {
dataIndex
:
'icon'
,
key
:
'icon'
,
align
:
'center'
,
width
:
1
2
0
,
width
:
1
0
0
,
render
:
(
text
,
record
)
=>
{
if
(
text
)
{
return
(
...
...
@@ -109,23 +109,31 @@ const IntegratedLogin = props => {
{
title
:
'链接类型'
,
dataIndex
:
'subType'
,
width
:
1
2
0
,
width
:
1
0
0
,
align
:
'center'
,
render
:
(
text
,
record
)
=>
subTypeMap
[
text
]
||
''
,
render
:
(
text
,
record
)
=>
{
if
(
text
===
'内链'
)
{
return
(
<>
<
span
style
=
{{
color
:
'#1685ff'
}}
>
{
record
.
client
||
''
}
<
/span>
(
站内
)
<
/
>
);
}
return
'站外跳转'
;
},
{
title
:
'APPKey'
,
dataIndex
:
'appKey'
,
width
:
120
,
align
:
'center'
,
},
{
title
:
'地址'
,
dataIndex
:
'url'
,
width
:
200
,
width
:
250
,
align
:
'center'
,
},
{
title
:
'AppKey'
,
dataIndex
:
'appKey'
,
width
:
100
,
align
:
'center'
,
},
{
title
:
'操作'
,
key
:
'action'
,
...
...
@@ -252,15 +260,15 @@ const IntegratedLogin = props => {
if
(
res
.
code
===
0
)
{
const
_allName
=
[];
const
_groupList
=
[];
res
.
data
.
forEach
(
item
=>
{
const
data
=
res
.
data
||
[];
data
.
forEach
(
item
=>
{
const
_name
=
item
.
name
;
_allName
.
push
(
_name
);
_groupList
.
push
({
value
:
_name
,
label
:
_name
});
});
setGroupList
(
_groupList
);
setKeepSystemName
(
_allName
);
setTableData
(
res
.
data
.
sort
((
a
,
b
)
=>
a
.
index
-
b
.
index
));
setTableData
(
data
.
sort
((
a
,
b
)
=>
a
.
index
-
b
.
index
));
}
else
{
res
.
msg
&&
message
.
error
(
res
.
msg
);
}
...
...
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