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

fix: 监听microError,跳转404错误

parent 4d8a2026
Pipeline #35865 passed with stages
in 30 minutes 54 seconds
......@@ -350,10 +350,10 @@ const BasicLayout = props => {
])
});
window.share && window.share.event.on('event:microError', event => {
// window.history.pushState({message: '应用服务请求异常,请检查应用配置'}, null, '/civbase/404')
history.push('/404');
});
// window.share && window.share.event.on('event:microError', event => {
// // window.history.pushState({message: '应用服务请求异常,请检查应用配置'}, null, '/civbase/404')
// history.push('/404');
// });
useEffect(() => {
window.share.event.on('updateSite', res => setCityData(res));
......
......@@ -163,10 +163,10 @@ export const initMicroApps = (loader, store) => {
// // window.history.pushState({message: '应用服务请求异常,请检查应用配置'}, null, '/civbase/500')
// }
console.log(event);
if(event.type === 'error') {
// window.history.pushState({message: '应用服务请求异常,请检查应用配置'}, null, '/civbase/404')
window.share && window.share.event.emit('event:microError');
}
// if(event.type === 'error') {
// // window.history.pushState({message: '应用服务请求异常,请检查应用配置'}, null, '/civbase/404')
// window.share && window.share.event.emit('event:microError');
// }
});
};
......
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