Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivWeb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivWeb
Commits
ad67bb3d
Commit
ad67bb3d
authored
3 years ago
by
邓晓峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 监听microError,跳转404错误
parent
4d8a2026
Pipeline
#35865
passed with stages
in 30 minutes 54 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
BasicLayout1.js
src/layouts/BasicLayout1.js
+4
-4
micro.js
src/micro.js
+4
-4
No files found.
src/layouts/BasicLayout1.js
View file @
ad67bb3d
...
...
@@ -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
));
...
...
This diff is collapsed.
Click to expand it.
src/micro.js
View file @
ad67bb3d
...
...
@@ -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');
//
}
});
};
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment