-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: 🐛 Fix routing error and add error page and handler
1. fix dynamic routing , change route mode to hash and avoid specific route from slug unknown BREAKING CHANGE: 🧨 route mode changed ✅ Closes: #8
- Loading branch information
Showing
7 changed files
with
132 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,9 @@ | ||
FROM node:fermium-buster-slim | ||
|
||
RUN echo 'registry=https://registry.npm.taobao.org/ \ | ||
ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/ \ | ||
ELECTRON_BUILDER_BINARIES_MIRROR=https://pan.yasking.org/electron-builder/ \ | ||
strict-ssl=false' > ~/.npmrc && mkdir /app | ||
|
||
FROM nginx:latest | ||
|
||
RUN mkdir -p /app | ||
WORKDIR /app | ||
|
||
COPY . . | ||
|
||
RUN yarn && yarn build | ||
COPY dist /usr/share/nginx/html | ||
|
||
EXPOSE 3010 | ||
EXPOSE 80 | ||
|
||
CMD ./start.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM node:fermium-buster-slim | ||
|
||
RUN echo 'registry=https://registry.npm.taobao.org/ \ | ||
ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/ \ | ||
ELECTRON_BUILDER_BINARIES_MIRROR=https://pan.yasking.org/electron-builder/ \ | ||
strict-ssl=false' > ~/.npmrc && mkdir /app | ||
|
||
|
||
WORKDIR /app | ||
|
||
COPY . . | ||
|
||
RUN yarn && yarn build | ||
|
||
EXPOSE 3010 | ||
|
||
CMD ./start.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<template> | ||
<div style="padding: 0;margin: 0; overflow: hidden;"> | ||
<div id="nav-parent"> | ||
<Navbar/> | ||
</div> | ||
<div> | ||
<Nuxt /> | ||
</div> | ||
<div style="margin: 0;padding: 0;"> | ||
<Footer/> | ||
</div> | ||
</div> | ||
</template> | ||
<script> | ||
import '@/assets/css/main.scss' | ||
export default { | ||
name: "empty", | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<template> | ||
<div class="error-page-container"> | ||
<h1 class="error-title" v-if="error.statusCode === 404">页面未找到</h1> | ||
<h1 class="error-title" v-else>发生了一个内部错误</h1> | ||
<NuxtLink class="error-nav-link" to="/">回到主页</NuxtLink> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'error', | ||
layout: 'empty', //OR layout:'default' | ||
props: { | ||
error: { | ||
type: Object, | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.error-page-container { | ||
min-height: 71vh; | ||
overflow: hidden; | ||
} | ||
.error-title { | ||
text-align: center; | ||
margin-top: 25vh; | ||
} | ||
.error-nav-link { | ||
text-decoration: none; | ||
color: #1ccb4c; | ||
text-align: center; | ||
margin-left: 46%; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters