Commit 6d9b183a authored by 周宏民's avatar 周宏民

fix: 修改集成登录 点击左上角,返回页面错误的问题

parent debe9adb
Pipeline #92729 failed with stages
...@@ -35,7 +35,7 @@ const BootPage = props => { ...@@ -35,7 +35,7 @@ const BootPage = props => {
useEffect(() => { useEffect(() => {
const tk = Cookies.get('token') || props.global.token; const tk = Cookies.get('token') || props.global.token;
const isLogin = tk !== null && tk !== 'undefined' && tk !== void 0; const isLogin = tk !== null && tk !== 'undefined' && tk !== void 0;
let client = props?.global?.client || sessionStorage.getItem('client') || null; let client = sessionStorage.getItem('client') || props?.global?.client || null;
client = client !== 'undefined' && !_.isNull(client) && !_.isUndefined(client) ? client : 'city'; client = client !== 'undefined' && !_.isNull(client) && !_.isUndefined(client) ? client : 'city';
const generateType = props.global && props.global.hasOwnProperty('get') ? props.global.get('generateType') : null; const generateType = props.global && props.global.hasOwnProperty('get') ? props.global.get('generateType') : null;
if (!isLogin) { if (!isLogin) {
...@@ -45,10 +45,6 @@ const BootPage = props => { ...@@ -45,10 +45,6 @@ const BootPage = props => {
} }
}, [props]); }, [props]);
useEffect(() => { useEffect(() => {
if (window?.globalConfig?.isIntegration >= 1) {
setInfo({ first: false, loading: false, error: false });
return false;
}
appService appService
.GetIntegratedloginSetting({ .GetIntegratedloginSetting({
ignoreSite: true, ignoreSite: true,
......
...@@ -60,6 +60,7 @@ const IntegrationMile = props => { ...@@ -60,6 +60,7 @@ const IntegrationMile = props => {
boxHeight: 930, boxHeight: 930,
}); });
const [integrationData, setIntegrationData] = useState({}); const [integrationData, setIntegrationData] = useState({});
const [logo, setLogo] = useState(props.global.logo);
const [linkUrl, setLinkUrl] = useState(''); const [linkUrl, setLinkUrl] = useState('');
// 解决 切换 client 时,updateConfig时,页会刷新,loading会重置 // 解决 切换 client 时,updateConfig时,页会刷新,loading会重置
...@@ -134,6 +135,17 @@ const IntegrationMile = props => { ...@@ -134,6 +135,17 @@ const IntegrationMile = props => {
} }
} }
}); });
const token = props.global?.token || Cookies.get('token');
const client = sessionStorage.getItem('client') || props?.global?.client || '';
getWebSiteConfig({
identity: token,
client,
})
.then(res => {
const data = res.data?.[0] || {};
if (data.logo) setLogo(data.logo);
})
.catch(err => {});
}; };
const onResize = () => { const onResize = () => {
if (ref?.current) { if (ref?.current) {
...@@ -444,7 +456,7 @@ const IntegrationMile = props => { ...@@ -444,7 +456,7 @@ const IntegrationMile = props => {
src={ src={
props.global && props.global &&
props.global.transformDevAssetsBaseURL && props.global.transformDevAssetsBaseURL &&
props.global.transformDevAssetsBaseURL(props.global.logo) props.global.transformDevAssetsBaseURL(logo || props.global.logo)
} }
alt="logo" alt="logo"
/> />
......
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