mirror of https://gitee.com/topiam/eiam
🐛 修复点击应用无法跳转问题
parent
d09b73d797
commit
284ee9a9d2
|
@ -15,17 +15,23 @@
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import type {ActionType} from '@ant-design/pro-components';
|
import type { ActionType } from '@ant-design/pro-components';
|
||||||
import {PageContainer, ProCard, ProFormText, ProList, QueryFilter,} from '@ant-design/pro-components';
|
import {
|
||||||
import {Avatar, Badge, Card, Typography} from 'antd';
|
PageContainer,
|
||||||
import React, {useRef, useState} from 'react';
|
ProCard,
|
||||||
import {AppGroupList, AppList} from './data.d';
|
ProFormText,
|
||||||
import {getAppGroupList, queryAppList} from './service';
|
ProList,
|
||||||
|
QueryFilter,
|
||||||
|
} from '@ant-design/pro-components';
|
||||||
|
import { Avatar, Badge, Card, Typography } from 'antd';
|
||||||
|
import React, { useRef, useState } from 'react';
|
||||||
|
import { AppGroupList, AppList } from './data.d';
|
||||||
|
import { getAppGroupList, queryAppList } from './service';
|
||||||
import useStyle from './style';
|
import useStyle from './style';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import {useAsyncEffect} from 'ahooks';
|
import { useAsyncEffect } from 'ahooks';
|
||||||
import {SpinProps} from 'antd/es/spin';
|
import { SpinProps } from 'antd/es/spin';
|
||||||
import {useIntl} from '@umijs/max';
|
import { useIntl } from '@umijs/max';
|
||||||
|
|
||||||
const { Paragraph } = Typography;
|
const { Paragraph } = Typography;
|
||||||
const prefixCls = 'topiam-app-list';
|
const prefixCls = 'topiam-app-list';
|
||||||
|
@ -55,7 +61,7 @@ const CardList = () => {
|
||||||
const [loading, setLoading] = useState<boolean | SpinProps | undefined>(false);
|
const [loading, setLoading] = useState<boolean | SpinProps | undefined>(false);
|
||||||
|
|
||||||
const getItems = () => {
|
const getItems = () => {
|
||||||
let data: { key: string; label: React.React.JSX.Element }[] = [
|
let data: { key: string; label: React.JSX.Element }[] = [
|
||||||
{
|
{
|
||||||
key: all,
|
key: all,
|
||||||
label: (
|
label: (
|
||||||
|
@ -82,15 +88,25 @@ const CardList = () => {
|
||||||
|
|
||||||
const initSso = (idpInitUrl: string) => {
|
const initSso = (idpInitUrl: string) => {
|
||||||
const div = window.document.createElement('div');
|
const div = window.document.createElement('div');
|
||||||
div.innerHTML =
|
const a = document.createElement('a');
|
||||||
"<form action='" +
|
a.href = idpInitUrl;
|
||||||
idpInitUrl +
|
const form = document.createElement('form');
|
||||||
"' method='POST' name='auto_submit_form' style='display:none'>";
|
form.method = 'GET';
|
||||||
|
form.action = a.origin + a.pathname; // 使用URL的origin和pathname部分作为action
|
||||||
|
form.name = 'auto_submit_form';
|
||||||
|
form.style.display = 'none';
|
||||||
|
form.target = '_blank';
|
||||||
|
const queryParams = new URLSearchParams(a.search);
|
||||||
|
queryParams.forEach((value, key) => {
|
||||||
|
const input = document.createElement('input');
|
||||||
|
input.type = 'hidden';
|
||||||
|
input.name = key;
|
||||||
|
input.value = value;
|
||||||
|
form.appendChild(input);
|
||||||
|
});
|
||||||
|
div.appendChild(form);
|
||||||
document.body.appendChild(div);
|
document.body.appendChild(div);
|
||||||
// eslint-disable-next-line @typescript-eslint/dot-notation
|
form.submit();
|
||||||
document.forms['auto_submit_form'].setAttribute('target', '_blank');
|
|
||||||
// eslint-disable-next-line @typescript-eslint/dot-notation
|
|
||||||
document.forms['auto_submit_form'].submit();
|
|
||||||
document.body.removeChild(div);
|
document.body.removeChild(div);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue