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

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

parent cb316db1
Pipeline #94442 passed with stages
......@@ -244,22 +244,38 @@ const IntegrationNew = props => {
toClient(item, loginA);
} else {
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.paramValue === 'ticket') {
toRevenue(item); // 去营收
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}=${
window.globalConfig?.token
}`;
if (item?.openOpt === '当前页打开') {
props.history.push('/thirdParty', { linkUrl: link });
} else {
setJumpLoading(false);
jumpProgressEnd();
window.open(link, '_blank');
}
axios({
url: link,
method: 'get',
dataType: 'json',
}).then(res => {
if (res?.data?.code === 0) {
if (item?.openOpt === '当前页打开') {
props.history.push('/thirdParty', { linkUrl: res.data?.data });
} else {
window.open(res.data?.data, '_blank');
}
}
});
}
};
......@@ -291,9 +307,10 @@ const IntegrationNew = props => {
9: [5, 4],
10: [5, 5],
};
const arr = rowMap[integrationData.length];
const arr = rowMap[integrationData.length] || rowMap[10];
const temp = [];
integrationData.forEach((i, index) => {
if (index >= 10) return;
if (index < arr[0]) {
if (!temp[0]) temp[0] = [];
temp[0].push(i);
......
......@@ -250,22 +250,39 @@ const IntegrationQinzhou = props => {
toClient(item, loginA);
} else {
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.paramValue === 'ticket') {
toRevenue(item); // 去营收
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}=${
window.globalConfig?.token
}`;
if (item?.openOpt === '当前页打开') {
props.history.push('/thirdParty', { linkUrl: link });
} else {
setJumpLoading(false);
jumpProgressEnd();
window.open(link, '_blank');
}
axios({
url: link,
method: 'get',
dataType: 'json',
}).then(res => {
if (res?.data?.code === 0) {
if (item?.openOpt === '当前页打开') {
props.history.push('/thirdParty', { linkUrl: res.data?.data });
} else {
window.open(res.data?.data, '_blank');
}
}
});
}
};
......
......@@ -566,7 +566,7 @@ const AddModal = props => {
<Radio.Group onChange={onChangeSubType}>
<Radio value="内链">站内跳转</Radio>
<Radio value="外链">站外跳转</Radio>
{/* <Radio value="自定义">自定义</Radio> */}
<Radio value="自定义">自定义</Radio> {/* 第三方鉴权选自定义,通过接口返回路径再跳转 */}
</Radio.Group>
</Item>
{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