Commit fa6eb9e9 authored by 周宏民's avatar 周宏民

pref: 修改 集成登录配置

parent d2045d42
Pipeline #93665 passed with stages
...@@ -162,6 +162,8 @@ const IntegrationNew = props => { ...@@ -162,6 +162,8 @@ const IntegrationNew = props => {
if (item?.openOpt === '当前页打开') { if (item?.openOpt === '当前页打开') {
props.history.push('/thirdParty', { linkUrl: apiPath }); props.history.push('/thirdParty', { linkUrl: apiPath });
} else { } else {
setJumpLoading(false);
jumpProgressEnd();
window.open(apiPath, '_blank'); window.open(apiPath, '_blank');
} }
} else { } else {
...@@ -178,7 +180,7 @@ const IntegrationNew = props => { ...@@ -178,7 +180,7 @@ const IntegrationNew = props => {
const toClient = async (item, loginA) => { const toClient = async (item, loginA) => {
const token = props.global?.token || Cookies.get('token'); const token = props.global?.token || Cookies.get('token');
const cli = item.appKey; const cli = item.client;
const res = await getWebSiteConfig({ const res = await getWebSiteConfig({
identity: token, identity: token,
client: cli, client: cli,
...@@ -229,9 +231,9 @@ const IntegrationNew = props => { ...@@ -229,9 +231,9 @@ const IntegrationNew = props => {
props.logout(); props.logout();
return; return;
} }
const { url, appKey } = item; const { url, client } = item;
if (item.subType === '内链' && appKey) { if (item.subType === '内链' && client) {
toClient(item, loginA); toClient(item, loginA);
} else { } else {
if (!url) return; if (!url) return;
...@@ -247,6 +249,8 @@ const IntegrationNew = props => { ...@@ -247,6 +249,8 @@ const IntegrationNew = props => {
if (item?.openOpt === '当前页打开') { if (item?.openOpt === '当前页打开') {
props.history.push('/thirdParty', { linkUrl: link }); props.history.push('/thirdParty', { linkUrl: link });
} else { } else {
setJumpLoading(false);
jumpProgressEnd();
window.open(link, '_blank'); window.open(link, '_blank');
} }
} }
......
...@@ -37,7 +37,6 @@ const AddModal = props => { ...@@ -37,7 +37,6 @@ const AddModal = props => {
const [imageType, setImageType] = useState(''); const [imageType, setImageType] = useState('');
const [previewModal, setPreviewModal] = useState(false); const [previewModal, setPreviewModal] = useState(false);
const [keepImgeUrl, setKeepImgeUrl] = useState(''); const [keepImgeUrl, setKeepImgeUrl] = useState('');
const [fileList, setFileList] = useState([]);
const [isVisibleRoles, setIsVisibleRoles] = useState(false); const [isVisibleRoles, setIsVisibleRoles] = useState(false);
const [groupName, setGroupName] = useState('角色'); const [groupName, setGroupName] = useState('角色');
const [chooseGroupName, setChooseGroupName] = useState(['角色']); const [chooseGroupName, setChooseGroupName] = useState(['角色']);
...@@ -83,20 +82,6 @@ const AddModal = props => { ...@@ -83,20 +82,6 @@ const AddModal = props => {
setLoading(true); setLoading(true);
const obj = form.getFieldsValue(); 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) { if (!imageUrl) {
message.error('请选择图标!'); message.error('请选择图标!');
return; return;
...@@ -107,7 +92,7 @@ const AddModal = props => { ...@@ -107,7 +92,7 @@ const AddModal = props => {
.SaveIntegrationConfig({ .SaveIntegrationConfig({
name: obj.name, name: obj.name,
type: targetType, type: targetType,
url: obj.url, url: obj.url || '',
roles: keepIds?.join(',') || '', roles: keepIds?.join(',') || '',
icon: imageUrl, icon: imageUrl,
userId: window.globalConfig.userInfo.OID, userId: window.globalConfig.userInfo.OID,
...@@ -120,6 +105,7 @@ const AddModal = props => { ...@@ -120,6 +105,7 @@ const AddModal = props => {
openOpt: obj.openOpt || '', openOpt: obj.openOpt || '',
backgroundImage: imageBgUrl, backgroundImage: imageBgUrl,
subTitle: obj.subTitle || '', subTitle: obj.subTitle || '',
client: obj.client || '',
}) })
.then(res => { .then(res => {
if (res.code === 0) { if (res.code === 0) {
...@@ -149,7 +135,7 @@ const AddModal = props => { ...@@ -149,7 +135,7 @@ const AddModal = props => {
id: pickItem.id, id: pickItem.id,
name: obj.name, name: obj.name,
type: pickItem.type, type: pickItem.type,
url: obj.url, url: obj.url || '',
roles: keepIds === null ? pickItem.roles : keepIds.join(','), roles: keepIds === null ? pickItem.roles : keepIds.join(','),
icon: imageUrl, icon: imageUrl,
userId: window.globalConfig.userInfo.OID, userId: window.globalConfig.userInfo.OID,
...@@ -162,6 +148,7 @@ const AddModal = props => { ...@@ -162,6 +148,7 @@ const AddModal = props => {
openOpt: obj.openOpt || '', openOpt: obj.openOpt || '',
backgroundImage: imageBgUrl, backgroundImage: imageBgUrl,
subTitle: obj.subTitle || '', subTitle: obj.subTitle || '',
client: obj.client || '',
}) })
.then(res => { .then(res => {
if (res.code === 0) { if (res.code === 0) {
...@@ -270,7 +257,11 @@ const AddModal = props => { ...@@ -270,7 +257,11 @@ const AddModal = props => {
setKeepImgeUrl(img); setKeepImgeUrl(img);
setPreviewModal(true); setPreviewModal(true);
}; };
const onChangeSubType = e => {
if (e.target.value === '外链') {
form.setFieldsValue({ openOpt: pickItem.openOpt || '当前页打开' });
}
};
const onOkImg = val => { const onOkImg = val => {
if (val) { if (val) {
if (imageType === 'backgroundImage') { if (imageType === 'backgroundImage') {
...@@ -347,6 +338,7 @@ const AddModal = props => { ...@@ -347,6 +338,7 @@ const AddModal = props => {
openOpt = '', openOpt = '',
backgroundImage, backgroundImage,
subTitle, subTitle,
client,
} = pickItem; } = pickItem;
form.setFieldsValue({ form.setFieldsValue({
paramName, paramName,
...@@ -362,12 +354,13 @@ const AddModal = props => { ...@@ -362,12 +354,13 @@ const AddModal = props => {
openOpt: openOpt || '', openOpt: openOpt || '',
backgroundImage, backgroundImage,
subTitle, subTitle,
client,
}); });
setImageUrl(icon || ''); setImageUrl(icon || '');
setImageBgUrl(backgroundImage || ''); setImageBgUrl(backgroundImage || '');
} else { } else {
form.setFieldsValue({ form.setFieldsValue({
paramValue: 'ticket', paramValue: '',
target: 0, target: 0,
mapSetting: '', mapSetting: '',
coordinate: '', coordinate: '',
...@@ -376,7 +369,6 @@ const AddModal = props => { ...@@ -376,7 +369,6 @@ const AddModal = props => {
}); });
} }
} else { } else {
setFileList([]);
setImageUrl(''); setImageUrl('');
setKeepImgeUrl(''); setKeepImgeUrl('');
form.resetFields(); form.resetFields();
...@@ -545,20 +537,30 @@ const AddModal = props => { ...@@ -545,20 +537,30 @@ const AddModal = props => {
</Item> </Item>
</Col> </Col>
</Row> </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 value="自定义">自定义</Radio> {/* <Radio value="自定义">自定义</Radio> */}
</Radio.Group> </Radio.Group>
</Item> </Item>
{subTypes !== '内链' ? ( {subTypes !== '内链' ? (
<> <>
{' '} <Item
<Item label="跳转方式" name="openOpt" initialValue="打开新链接"> label="跳转方式"
name="openOpt"
initialValue="打开新链接"
rules={[{ required: true, message: '请选择打开新链接' }]}
>
<Radio.Group> <Radio.Group>
<Radio value="新窗口打开">新窗口打开</Radio>
<Radio value="当前页打开">当前页打开</Radio> <Radio value="当前页打开">当前页打开</Radio>
<Radio value="新窗口打开">新窗口打开</Radio>
</Radio.Group> </Radio.Group>
</Item> </Item>
<Item label="地址" name="url" rules={[{ required: true, message: '请输入站点路径' }]}> <Item label="地址" name="url" rules={[{ required: true, message: '请输入站点路径' }]}>
...@@ -570,69 +572,109 @@ const AddModal = props => { ...@@ -570,69 +572,109 @@ const AddModal = props => {
labelCol={{ span: 8 }} labelCol={{ span: 8 }}
label="参数名" label="参数名"
name="paramName" name="paramName"
tooltip={{
title: '直接跳转,不需要填该参数,若与每三方对接,需要该参数',
icon: <InfoCircleOutlined />,
}}
// rules={[{ required: true, message: '请输入参数' }]} // rules={[{ required: true, message: '请输入参数' }]}
> >
<Input allowClear placeholder="请填写站点参数" /> <Input allowClear placeholder="请填写站点参数" />
</Item> </Item>
</Col> </Col>
<Col span={10}> <Col span={10}>
<Item label="参数值" labelCol={{ span: 7 }} name="paramValue"> <Item
label="参数值"
labelCol={{ span: 7 }}
name="paramValue"
tooltip={{
title: '直接跳转,不需要填该参数,若与第三方对接,需要该参数,若跳转捷普营收,请选择ticket',
icon: <InfoCircleOutlined />,
}}
>
<Select placeholder="请选择参数值"> <Select placeholder="请选择参数值">
<Option value="ticket">ticket</Option> <Option value="ticket" />
<Option value="token">token</Option> <Option value="token">token</Option>
</Select> </Select>
</Item> </Item>
</Col> </Col>
</Row> </Row>
{ {/* <Item
<> label="AppKey"
<Item name="appKey"
label="AppKey" className={styles.disabledInput}
name="appKey" // rules={[{ required: true, message: '请输入参数' }]}
className={styles.disabledInput} >
// rules={[{ required: true, message: '请输入参数' }]} <Input placeholder="请输入自定义的AppKey," />
> </Item> */}
<Input disabled={type === 'edit'} placeholder="请输入自定义的AppKey,提交后不可变更" /> {/* <Item
</Item> label="AppSecret"
<Item name="appSecret"
label="AppSecret" className={styles.disabledInput}
name="appSecret" // rules={[{ required: true, message: '请输入AppKey,或点击刷新按钮重新获取AppSecret' }]}
className={styles.disabledInput} >
// rules={[{ required: true, message: '请输入AppKey,或点击刷新按钮重新获取AppSecret' }]} <Input
> disabled
<Input placeholder="请点击按钮生成AppSecret"
disabled suffix={
placeholder="请点击按钮生成AppSecret" <Tooltip title="点击按钮重新生成AppSecret">
suffix={ <RedoOutlined
<Tooltip title="点击按钮重新生成AppSecret"> style={{ fontSize: 'bold', color: 'rgba(25,128,255,0.74)' }}
<RedoOutlined onClick={refreshAppSecret}
style={{ fontSize: 'bold', color: 'rgba(25,128,255,0.74)' }} />
onClick={refreshAppSecret} </Tooltip>
/> }
</Tooltip> />
} </Item> */}
/> {/* <Item label="白名单" name="whiteList">
</Item>
</>
}
<Item label="白名单" name="whiteList">
<TextArea rows={3} /> <TextArea rows={3} />
</Item> </Item> */}
</> </>
) : ( ) : (
<Item <>
label="AppKey" <Item label="client" name="client" rules={[{ required: true, message: '请输入网站client' }]}>
name="appKey" <Input placeholder="请输入网站client" />
className={styles.disabledInput} </Item>
rules={[{ required: true, message: '请输入参数' }]} <Item
> label="地址"
<Input disabled={type === 'edit'} placeholder="请输入网站client,提交后不可变更" /> name="url"
</Item> 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 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> </Form>
<PreviewModal <PreviewModal
visible={previewModal} visible={previewModal}
......
...@@ -76,7 +76,7 @@ const IntegratedLogin = props => { ...@@ -76,7 +76,7 @@ const IntegratedLogin = props => {
dataIndex: 'icon', dataIndex: 'icon',
key: 'icon', key: 'icon',
align: 'center', align: 'center',
width: 120, width: 100,
render: (text, record) => { render: (text, record) => {
if (text) { if (text) {
return ( return (
...@@ -109,23 +109,31 @@ const IntegratedLogin = props => { ...@@ -109,23 +109,31 @@ const IntegratedLogin = props => {
{ {
title: '链接类型', title: '链接类型',
dataIndex: 'subType', dataIndex: 'subType',
width: 120, width: 100,
align: 'center', align: 'center',
render: (text, record) => subTypeMap[text] || '', render: (text, record) => {
if (text === '内链') {
return (
<>
<span style={{ color: '#1685ff' }}>{record.client || ''}</span>(站内)
</>
);
}
return '站外跳转';
},
}, },
{ {
title: 'APPKey', title: '地址',
dataIndex: 'appKey', dataIndex: 'url',
width: 120, width: 250,
align: 'center', align: 'center',
}, },
{ {
title: '地址', title: 'AppKey',
dataIndex: 'url', dataIndex: 'appKey',
width: 200, width: 100,
align: 'center', align: 'center',
}, },
{ {
title: '操作', title: '操作',
key: 'action', key: 'action',
...@@ -252,15 +260,15 @@ const IntegratedLogin = props => { ...@@ -252,15 +260,15 @@ const IntegratedLogin = props => {
if (res.code === 0) { if (res.code === 0) {
const _allName = []; const _allName = [];
const _groupList = []; const _groupList = [];
const data = res.data || [];
res.data.forEach(item => { data.forEach(item => {
const _name = item.name; const _name = item.name;
_allName.push(_name); _allName.push(_name);
_groupList.push({ value: _name, label: _name }); _groupList.push({ value: _name, label: _name });
}); });
setGroupList(_groupList); setGroupList(_groupList);
setKeepSystemName(_allName); setKeepSystemName(_allName);
setTableData(res.data.sort((a, b) => a.index - b.index)); setTableData(data.sort((a, b) => a.index - b.index));
} else { } else {
res.msg && message.error(res.msg); res.msg && message.error(res.msg);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment