diff --git a/src/assets/img/qr.png b/src/assets/img/qr.png new file mode 100644 index 0000000..f251771 Binary files /dev/null and b/src/assets/img/qr.png differ diff --git a/src/components/NotFound/NotFound.vue b/src/components/NotFound/NotFound.vue new file mode 100644 index 0000000..4d5865c --- /dev/null +++ b/src/components/NotFound/NotFound.vue @@ -0,0 +1,151 @@ + + + + + :( + Your PC ran into a problem and needs to restart. We're just collecting some error info, and then we'll restart for + you. + + 58% complete + + + + + + + + For more information about this issue and possible fixes, visit + http://xontab.com/stopcode + If you call a support person, give them this info: + Stop Code: 404 PAGE NOT FOUND + + + + + + + + + + \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index 6640666..5208f8b 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,8 +1,13 @@ -import { createRouter, createWebHashHistory } from 'vue-router' +import {createRouter, createWebHashHistory } from 'vue-router' import index from '../views/Index.vue' import home from "@/components/Home/HomePage.vue"; import hotNews from "@/components/HotNews/HotNews.vue"; import navDetail from "@/components/Detail/NavDetail.vue"; +import notFound from "@/components/NotFound/NotFound.vue"; + + + + const routes = [ { path: '/', @@ -30,6 +35,17 @@ const routes = [ } ], }, + { + path: '/404', + name: 'NoPage404', + component: notFound, + hidden: true + }, + { + path: '/:pathMatch(.*)', + redirect: '/404', + hidden: true + } ] diff --git a/vue.config.js b/vue.config.js index e5ba0de..6c2de53 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,5 +1,44 @@ const { defineConfig } = require('@vue/cli-service') module.exports = defineConfig({ transpileDependencies: true, + devServer: { + client: { + overlay: false // 编译错误时,取消全屏覆盖 + }, + proxy: { + '/api': { + //后端接口的baseurl + target: 'http://localhost:8082/helloGithub_war_exploded', + //是否允许跨域 + changeOrigin: true, + // ws: true, //是否代理 websockets + // secure: true, + // 'secure': true, + headers: { + Connection: "kepp-alive" + }, + pathRewrite: { + //这里的作用是使用去掉api + '^/api': '' + } + }, + '/image': { + //后端接口的baseurl + target: 'https://tucdn.wpon.cn/api/', + //是否允许跨域 + changeOrigin: true, + // ws: true, //是否代理 websockets + // secure: true, + // 'secure': true, + headers: { + Connection: "kepp-alive" + }, + pathRewrite: { + //这里的作用是使用去掉api + '^/image': '' + } + }, + } + } })