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 @@