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

fix: 修复首页路径bug

parent 2ffe952b
Pipeline #38840 passed with stages
in 12 minutes 57 seconds
......@@ -124,7 +124,7 @@ const initGlobalConfig = () => {
// eslint-disable-next-line react-hooks/rules-of-hooks
appService
.queryConfig({
client: params.getParams('client') || 'city',
client: params.getParams('client') || 'city',
})
.then(res => {
if (res) {
......@@ -132,7 +132,7 @@ const initGlobalConfig = () => {
if (!data.client) {
data.client = params.getParams('client') || 'city';
}
// Cookies.set('city', Cookies.get('city'));
Cookies.set('city', Cookies.get('city'));
store.dispatch(
actionCreators.getConfig(
Object.assign({}, window.globalConfig, data),
......@@ -187,6 +187,8 @@ const initGlobalConfig = () => {
}
};
const initSensorType = () => {
let filterProduct =
(window.globalConfig && window.globalConfig.products) || [];
......@@ -224,11 +226,12 @@ const initIsMock = () => {
initGlobalConfig();
initLocale();
window.share &&
window.share.event &&
window.share.event.on('triggerMicro', () => {
window.share && window.share.event && window.share.event.on('triggerMicro', () => {
initMicroApps(loader, store);
});
});
window.share && window.share.event && window.share.event.on('initConfig', () => {
initGlobalConfig();
});
if (pwa) {
// const appPWA = window.i18n.getI18n('app');
......
......@@ -178,7 +178,8 @@ export function logout(data) {
path: '/',
});
window.globalConfig.token = null;
window.globalConfig.access_token = null
window.globalConfig.access_token = null;
window.globalConfig.hasGateWay = false;
}
Cookies.set('token', '', {
......
......@@ -30,6 +30,7 @@ class SecurityLayout extends React.Component {
if(_.isNull(global.token) || (global.hasGateWay && _.isNull(global.access_token))) {
this.props.updateCurrentIndex && this.props.updateCurrentIndex(0);
window.share && window.share.event && window.share.event.emit('initConfig')
return (
<Redirect to={`/user/login?client=${global.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