Commit 3910aab1 authored by 张瑶's avatar 张瑶

feat: 重定向传递generateType参数,修复client=undefined问题

parent 12c539fd
Pipeline #42883 passed with stages
in 1 minute 36 seconds
......@@ -332,8 +332,10 @@ const BasicLayout = props => {
siteAction.setGlobalConfig(props.global);
if (!Cookies.get('token')) {
let client = props.global && props.global.client;
client = client !== 'undefined' || !_.isNull(client) || !_.isUndefined(client) ? client: 'city';
history.replace(`/user/login?client=${client}`);
client = client !== 'undefined' && !_.isNull(client) && !_.isUndefined(client) ? client: 'city';
let generateType = props.global.get('generateType');
generateType = !_.isNull(generateType) && !_.isUndefined(generateType) && generateType !== 'undefined' ? `&generateType=${generateType}` : '';
history.replace(`/user/login?client=${client}${generateType}`);
props.logout();
return;
}
......
......@@ -21,23 +21,21 @@ class SecurityLayout extends React.Component {
}
render() {
const { isReady } = this.state;
const { children, global, loading } = this.props;
const isLogin = Cookies.get('token') !== null && global.token !== null;
// const queryString = stringify({
// redirect: window.location.href,
// });
if(_.isNull(global.token) || (global.hasGateWay && _.isNull(global.access_token))) {
debugger
this.props.updateCurrentIndex && this.props.updateCurrentIndex(0);
let client = global.client || Cookies.get('city');
client = client !== 'undefined' || !_.isNull(client) || !_.isUndefined(client) ? client: 'city';
client = client !== 'undefined' && !_.isNull(client) && !_.isUndefined(client) ? client: 'city';
// event.emit(?'event:initConfig');
let generateType = global.generateType;
generateType = !_.isNull(generateType) && !_.isUndefined(generateType) && generateType !== 'undefined' ? `&generateType=${generateType}` : '';
return (
<Redirect to={`/user/login?client=${client}`} render={() => window.location.reload()}/>
<Redirect to={`/user/login?client=${client}${generateType}`} render={() => window.location.reload()}/>
);
}
......
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