From bf077ca17a2960ccf3a137596d44ab0faa46df1b Mon Sep 17 00:00:00 2001 From: Qing Date: Wed, 20 Dec 2023 01:48:24 +0800 Subject: [PATCH] add 404 page --- src/assets/img/qr.png | Bin 0 -> 2982 bytes src/components/NotFound/NotFound.vue | 151 +++++++++++++++++++++++++++ src/router/index.js | 18 +++- vue.config.js | 39 +++++++ 4 files changed, 207 insertions(+), 1 deletion(-) create mode 100644 src/assets/img/qr.png create mode 100644 src/components/NotFound/NotFound.vue diff --git a/src/assets/img/qr.png b/src/assets/img/qr.png new file mode 100644 index 0000000000000000000000000000000000000000..f25177101ab758f20fdb00774a88fcfa27dc7daf GIT binary patch literal 2982 zcmeHJX;4#V6b&GXVXrf=3h6({hHi1bp;8<(WvTx!BG9n;Bc)c%ZWyWfq_Git!EqCsBa_>3!d@rf) zuDdkJE65}gNz>WM!GlCn+C-dcDiCq~>F6%FDe*jZ*^^3I4IaUl1wnQ$b|li(4E0xj zsw9#M$$ig0M{_jCns>2tXmsG|*yPkSj^mK|>GO$!{|N(y>G}H5>SB%)!XuHi8i-S= zIsBIZ2H0@#dhEMz9q}VH1@FxJsz>0o!Mh68XxbP{PntgX> zQMpJYxIeKF+uGjMBMfZUXURfh6QyTE!#POluqHjYthx?uDPweCQFy3W?k}F!jQ?XM zS3bG3<%QKcDghbcD|_H#^Q5$#v8g*??5o6p+R?jv!?{yBXq4rW-RA6^oB4ybt0y$2mH5J+`)1nt;|$9@ta8TX&=7F@0*${^C^?e(o}r4_ zkhV_W%)qRpzk}&3lb8CPSZSoq-_g1_HPgWF!jvI;>Daa?U2BpTmq6SB$=&ETn|*c(%`h9n2pQ$6QJmSGg9q<}u5a%$!t z7IU>WKUGSm+M9Ec1P7DKlTva>5R1v))-P0U*TX3HT1A4|w<-6t8#S@n1*bFjT{WR9Dud!Y zL)68`dk1a^rh`h@-UPaXQ<8(z#d|t@rG`}LH*6~|qOP%y9-Pp76E!i*7YS5TmSNXw zIekJMU00S&c`m6a`!0f?bUDETNCmV?ib_gs{xbd=!Il~yodyNP8U(W%x>~v;(8sAO zAH^%dean}KfmOXkn+b&xM?ft{L9ID^J;9DHnV>60!QXj;(2olr-VmIwKZiI0_AN-< zmT|?L{R0r`2dt(5f4YHy_5MI^qR^&;MvcucKHv>SW$-|fn51liG!)qJ0{K*#Yk|2B zhpwM#yuU`E;D+!3!4O$o*e?e)Sp`td6VR6v4<(h{0y)Q_F40a9xDAx>kVy0pC>|vRt!SaCUns2Ad7kGqaGeC$!V-Gtv9V~wkAAW`>(GZ*f?ymmmAy_oX-tE;mva$ zm}l=hnS38T#o6LEE>v}gGstD?P`;7`Id3X{g>xA(L9g%SC|&=(Ij zI&KLF(7KgQYp#HHt=hnPLo2ZCc}Xt5GJpKrN!-ylr}OQmJnyCbI=FIr{E2Nr(0-f2 Tyui)GUngfrSBDaN_IG~*#itb4 literal 0 HcmV?d00001 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 @@ + + + + + \ 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': '' + } + }, + } + } })