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

fix: 集成登录添加自定义第三方鉴权再跳转

parent cb316db1
Pipeline #94442 passed with stages
...@@ -244,22 +244,38 @@ const IntegrationNew = props => { ...@@ -244,22 +244,38 @@ const IntegrationNew = props => {
toClient(item, loginA); toClient(item, loginA);
} else { } else {
if (!url) return; if (!url) return;
if (url?.indexOf('{userId}') >= 0) {
item.url = url.replace('{userId}', window.globalConfig?.userInfo?.OID);
}
let link = item.url;
if (item.paramName) {
link = `${item.url + (item.url.indexOf('?') > 0 ? '&' : '?') + item.paramName}=${window.globalConfig?.token}`;
}
if (item.subType === '外链') { if (item.subType === '外链') {
if (item.paramValue === 'ticket') { if (item.paramValue === 'ticket') {
toRevenue(item); // 去营收 toRevenue(item); // 去营收
return; return;
} }
if (item?.openOpt === '当前页打开') {
props.history.push('/thirdParty', { linkUrl: url });
} else {
window.open(url, '_blank');
}
return;
} }
const link = `${item.url + (item.url.indexOf('?') > 0 ? '&' : '?') + item.paramName}=${ axios({
window.globalConfig?.token url: link,
}`; method: 'get',
if (item?.openOpt === '当前页打开') { dataType: 'json',
props.history.push('/thirdParty', { linkUrl: link }); }).then(res => {
} else { if (res?.data?.code === 0) {
setJumpLoading(false); if (item?.openOpt === '当前页打开') {
jumpProgressEnd(); props.history.push('/thirdParty', { linkUrl: res.data?.data });
window.open(link, '_blank'); } else {
} window.open(res.data?.data, '_blank');
}
}
});
} }
}; };
...@@ -291,9 +307,10 @@ const IntegrationNew = props => { ...@@ -291,9 +307,10 @@ const IntegrationNew = props => {
9: [5, 4], 9: [5, 4],
10: [5, 5], 10: [5, 5],
}; };
const arr = rowMap[integrationData.length]; const arr = rowMap[integrationData.length] || rowMap[10];
const temp = []; const temp = [];
integrationData.forEach((i, index) => { integrationData.forEach((i, index) => {
if (index >= 10) return;
if (index < arr[0]) { if (index < arr[0]) {
if (!temp[0]) temp[0] = []; if (!temp[0]) temp[0] = [];
temp[0].push(i); temp[0].push(i);
......
...@@ -250,22 +250,39 @@ const IntegrationQinzhou = props => { ...@@ -250,22 +250,39 @@ const IntegrationQinzhou = props => {
toClient(item, loginA); toClient(item, loginA);
} else { } else {
if (!url) return; if (!url) return;
if (url?.indexOf('{userId}') >= 0) {
item.url = url.replace('{userId}', window.globalConfig?.userInfo?.OID);
}
let link = item.url;
if (item.paramName) {
link = `${item.url + (item.url.indexOf('?') > 0 ? '&' : '?') + item.paramName}=${window.globalConfig?.token}`;
}
if (item.subType === '外链') { if (item.subType === '外链') {
if (item.paramValue === 'ticket') { if (item.paramValue === 'ticket') {
toRevenue(item); // 去营收 toRevenue(item); // 去营收
return; return;
} }
if (item?.openOpt === '当前页打开') {
props.history.push('/thirdParty', { linkUrl: url });
} else {
window.open(url, '_blank');
}
return;
} }
const link = `${item.url + (item.url.indexOf('?') > 0 ? '&' : '?') + item.paramName}=${ axios({
window.globalConfig?.token url: link,
}`; method: 'get',
if (item?.openOpt === '当前页打开') { dataType: 'json',
props.history.push('/thirdParty', { linkUrl: link }); }).then(res => {
} else { if (res?.data?.code === 0) {
setJumpLoading(false); if (item?.openOpt === '当前页打开') {
jumpProgressEnd(); props.history.push('/thirdParty', { linkUrl: res.data?.data });
window.open(link, '_blank'); } else {
} window.open(res.data?.data, '_blank');
}
}
});
} }
}; };
......
...@@ -566,7 +566,7 @@ const AddModal = props => { ...@@ -566,7 +566,7 @@ const AddModal = props => {
<Radio.Group onChange={onChangeSubType}> <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 !== '内链' ? (
......
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