Commit 52d08874 authored by lihonglin's avatar lihonglin
parents 3262ec0b e0fa683e
Pipeline #66470 passed with stages
......@@ -114,9 +114,9 @@
"@wisdom-map/arcgismap": "1.4.0-114",
"@wisdom-map/basemap": "1.1.0-20",
"@wisdom-map/util": "^1.0.28-0",
"@wisdom-utils/components": "0.1.284",
"@wisdom-utils/components": "0.1.286",
"@wisdom-utils/runtime": "0.0.38",
"@wisdom-utils/utils": "0.1.324",
"@wisdom-utils/utils": "0.1.326",
"animate.css": "^4.1.1",
"antd": "4.21.2",
"compression": "1.7.4",
......
......@@ -397,7 +397,6 @@ const Layout = props => {
props.global.userInfo.site = '';
}
}
return (
<SecurityLayout {...props}>
<BasicLayout
......@@ -406,6 +405,7 @@ const Layout = props => {
location={location}
navTheme={props.global?.variableTheme?.navTheme ?? 'dark'}
homepage={props.global?.homepage ?? ''}
redirect={props.global?.redirect ?? ''}
mode="MDI"
fixedHeader
headerHeight={52}
......
/* eslint-disable no-empty */
/* eslint-disable react-hooks/exhaustive-deps */
/* eslint-disable no-undef */
import '@wisdom-utils/utils/lib/helpers/format';
import { params } from '@wisdom-utils/utils/lib/helpers';
import React, { forwardRef, useEffect, useRef, useState } from 'react';
......@@ -29,14 +32,23 @@ const Login = forwardRef((props, _ref) => {
action &&
action.events.on('loginSuccess', event => {
// http://127.0.0.1:8080/civbase/civweb4/
// props.updateConfig(Object.assign({}, props.global, {
// homepage: params.getParams('redirect')
// }));
props.updateConfig(
Object.assign({}, window.globalConfig, {
redirect,
}),
);
let url = '';
try {
url =
_.isString(redirect) && redirect.replace(new RegExp(/ /g), '').length > 0
? redirect.replace('&skipHome=true', '')
: '';
} catch (error) {}
// props.history.push('/' + params.getParams('redirect'))
props.history.push(`/?client=${props.global.client}`);
// window.share.event.emit('triggerMicro', props.global);
// initMicroApps();
defaultApp(redirect);
defaultApp(url);
});
return () => {
action && action.events && action.events.removeAllListeners('loginSuccess');
......
......@@ -58,8 +58,14 @@ export const AppInitState = () => {
const client = value && value !== 'undefined' ? value : 'city';
return client;
};
const getUrlToken = () => {
const value = params.getParams('token');
const token = value && value !== 'undefined' ? value : null;
return token;
};
const client = getClient();
const token = getUrlToken();
if (sessionStorage.getItem('client') !== client) {
sessionStorage.setItem('client', client);
}
......@@ -164,7 +170,8 @@ export const AppInitState = () => {
initMicroApps();
}
// eslint-disable-next-line no-new
if (getToken()) {
// 增加免登判定
if (!token && getToken()) {
// eslint-disable-next-line no-new
const action = new Login(
{
......
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