diff --git a/app/create-app.js b/app/create-app.js index 3d82113..8821ce4 100644 --- a/app/create-app.js +++ b/app/create-app.js @@ -78,7 +78,7 @@ const Error = { } } -function createRootComponent(entry, context) { +function createRootComponent(entry) { const { root = Root, error = Error } = entry return { @@ -114,7 +114,7 @@ function createRootComponent(entry, context) { }, computed: { actualError() { - const error = context.req ? context.reamError : this.error + const error = this.error if (error && error.errorPath) { return error.errorPath === this.$route.path ? error : null } @@ -139,7 +139,7 @@ export default function createApp(context) { } const rootOptions = { - ...createRootComponent(entry, context), + ...createRootComponent(entry), _isReamRoot: true, router: entry.router || new Router({ mode: 'history' }) } diff --git a/app/server-entry.js b/app/server-entry.js index 0696d00..64702d6 100644 --- a/app/server-entry.js +++ b/app/server-entry.js @@ -26,7 +26,7 @@ export default async context => { if (matchedComponents.length === 0) { if (res) { res.statusCode = 404 - context.reamError = pageNotFound(req.url) + app.setError(pageNotFound(req.url)) } else { throw new ReamError({ code: 'NOT_FOUND',