From a4e125e31c33ca09e252762d6ca743c1f627c9f3 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 11 Feb 2025 17:16:57 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=83=A8=E5=88=86=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 15 +++++-- src/router/systemRouter.js | 5 --- src/views/sys/dept.vue | 2 +- src/views/sys/dict.vue | 4 +- src/views/sys/task.vue | 22 +++++----- src/views/sys/taskLogs.vue | 86 +++++--------------------------------- 6 files changed, 36 insertions(+), 98 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 27de5eda..72dea5be 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -12,6 +12,11 @@ import { beforeEach, afterEach } from './scrollBehavior'; const routes = systemRouter //系统特殊路由 +const routes_404 = { + path: "/:pathMatch(.*)*", + hidden: true, + component: () => import(/* webpackChunkName: "404" */ '@/layout/other/404'), +} let routes_404_r = () => { } const router = createRouter({ @@ -79,12 +84,14 @@ router.beforeEach(async (to, from, next) => { router.addRoute("layout", item) }); routes_404_r = router.addRoute(routes_404); - if (to.matched.length == 0) { - router.push(to.fullPath); - } isGetRouter = true; + next({ ...to, replace: true }); // 重新触发导航 + return; }catch (e) { - + isGetRouter = false; + console.error('路由加载失败:', e); + next('/login'); + return; } } diff --git a/src/router/systemRouter.js b/src/router/systemRouter.js index 877edd21..ae775add 100644 --- a/src/router/systemRouter.js +++ b/src/router/systemRouter.js @@ -16,11 +16,6 @@ const routes = [ title: "登录" } }, - { - path: "/:pathMatch(.*)*", - hidden: true, - component: () => import(/* webpackChunkName: "404" */ '@/layout/other/404'), - }, { path: "/user_register", component: () => import(/* webpackChunkName: "userRegister" */ '@/views/login/userRegister'), diff --git a/src/views/sys/dept.vue b/src/views/sys/dept.vue index 122ead3b..0f1f162c 100644 --- a/src/views/sys/dept.vue +++ b/src/views/sys/dept.vue @@ -60,6 +60,7 @@ > diff --git a/src/views/sys/dict.vue b/src/views/sys/dict.vue index 1d4e8aad..349d3120 100644 --- a/src/views/sys/dict.vue +++ b/src/views/sys/dict.vue @@ -24,7 +24,7 @@ - 字典分类 + 字典分类 @@ -36,7 +36,7 @@ - + diff --git a/src/views/sys/task.vue b/src/views/sys/task.vue index 9d0f7b52..b30fd333 100644 --- a/src/views/sys/task.vue +++ b/src/views/sys/task.vue @@ -16,22 +16,22 @@
- 启用 - 停用 + 启用 + 停用
- + @@ -40,7 +40,7 @@ - +

添加计划任务

@@ -77,8 +77,8 @@ - - + + @@ -118,6 +118,7 @@ visible: false, isSaving: false, logsVisible: false, + ptask: "" } }, mounted() { @@ -180,7 +181,8 @@ //取消 }) }, - logs(){ + logs(item){ + this.ptask = item; this.logsVisible = true }, run(task){ diff --git a/src/views/sys/taskLogs.vue b/src/views/sys/taskLogs.vue index fe435dd7..73ca9733 100644 --- a/src/views/sys/taskLogs.vue +++ b/src/views/sys/taskLogs.vue @@ -1,96 +1,30 @@