Commit c58f1b7f authored by 徐乐's avatar 徐乐

perf: 修改集成登录自定义跳转问题

parent 0fcf8ec9
Pipeline #88756 passed with stages
...@@ -14,6 +14,7 @@ import { defaultApp } from '@/micro'; ...@@ -14,6 +14,7 @@ import { defaultApp } from '@/micro';
import { appService } from '@/api'; import { appService } from '@/api';
import { SERVICE_INTERFACE_SUCCESS_CODE } from '@/constants'; import { SERVICE_INTERFACE_SUCCESS_CODE } from '@/constants';
import styles from './index.less'; import styles from './index.less';
import axios from 'axios';
const Integration = props => { const Integration = props => {
const dataRef = useRef(); const dataRef = useRef();
...@@ -62,7 +63,7 @@ const Integration = props => { ...@@ -62,7 +63,7 @@ const Integration = props => {
let url = item.url + (item.url.indexOf('?') > 0 ? '&' : '?') + item.paramName + '=' + window.globalConfig?.token; let url = item.url + (item.url.indexOf('?') > 0 ? '&' : '?') + item.paramName + '=' + window.globalConfig?.token;
window.open(url, "_blank"); window.open(url, "_blank");
} }
} else { } else if (item.subType == '内链') {
if (window.qiankunIsCache) { if (window.qiankunIsCache) {
store.set('event:dropCache'); store.set('event:dropCache');
} }
...@@ -93,6 +94,20 @@ const Integration = props => { ...@@ -93,6 +94,20 @@ const Integration = props => {
// props.instance && props.instance.updateConfig(config); // props.instance && props.instance.updateConfig(config);
loginAction && loginAction.getUserInfoAndConfig('', true, item.type); loginAction && loginAction.getUserInfoAndConfig('', true, item.type);
} else {
let url = item.url;
if (url?.indexOf('{userId}') >= 0) {
url = url.replace('{userId}', window.globalConfig?.userInfo?.OID);
}
axios({
url: url,
method: 'get',
dataType: 'json'
}).then(res => {
if (res?.data?.code === 0) {
window.location.href = res.data?.data;
}
});
} }
}; };
......
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