Commit ab440bde authored by 邓晓峰's avatar 邓晓峰

fix: 修复退出登录

parent 1a328d61
Pipeline #39158 passed with stages
in 13 minutes 30 seconds
......@@ -463,7 +463,10 @@ const BasicLayout = props => {
useEffect(() => {
siteAction.setGlobalConfig(props.global);
if (!Cookies.get('token')) {
history.replace(`/user/login?client=${props.global.get('client')}`);
debugger
let client = props.global.get('client');
client = _.isNull(client) || _.isUndefined(client) || client === 'undefined' ? client: 'city';
history.replace(`/user/login?client=${client}`);
props.logout();
return;
}
......
......@@ -323,7 +323,9 @@ const BasicLayout = props => {
useEffect(() => {
siteAction.setGlobalConfig(props.global);
if (!Cookies.get('token')) {
history.replace(`/user/login?client=${props.global.get('client')}`);
let client = props.global.get('client');
client = client !== 'undefined' || !_.isNull(client) || !_.isUndefined(client) ? client: 'city';
history.replace(`/user/login?client=${client}`);
props.logout();
return;
}
......
......@@ -30,7 +30,8 @@ class SecurityLayout extends React.Component {
if(_.isNull(global.token) || (global.hasGateWay && _.isNull(global.access_token))) {
this.props.updateCurrentIndex && this.props.updateCurrentIndex(0);
const client = _.isNull(global.client) || _.isUndefined(global.client) ? global.client: 'city';
debugger
const client = global.client !== 'undefined' || !_.isNull(global.client) || !_.isUndefined(global.client) ? global.client: 'city';
return (
<Redirect to={`/user/login?client=${client}`} />
);
......
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