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