diff --git a/tonecn/src/router/index.ts b/tonecn/src/router/index.ts index 7a15511..ee937eb 100644 --- a/tonecn/src/router/index.ts +++ b/tonecn/src/router/index.ts @@ -45,6 +45,11 @@ const router = createRouter({ component: () => import('../views/Console/Dashboard.vue') } ], + }, + { + path: '/:pathMatch(.*)*', + name: 'notFound', + component: () => import('../views/NotFound.vue') } ] }) diff --git a/tonecn/src/views/HomeView.vue b/tonecn/src/views/HomeView.vue index 12aba29..3f180d3 100644 --- a/tonecn/src/views/HomeView.vue +++ b/tonecn/src/views/HomeView.vue @@ -8,8 +8,7 @@ onMounted(() => { // 界面特效字体 let nameElement = document.getElementById("my-name"); if (nameElement == null) { - console.error('未找到元素my-name') - return; + return console.error('未找到元素my-name') } let colorNum = 66; let colorNumReverse = false; diff --git a/tonecn/src/views/NotFound.vue b/tonecn/src/views/NotFound.vue new file mode 100644 index 0000000..6fbc547 --- /dev/null +++ b/tonecn/src/views/NotFound.vue @@ -0,0 +1,38 @@ + + + \ No newline at end of file