From d7d29c468c8449b264fae6b043bbc9ec7e48f9a6 Mon Sep 17 00:00:00 2001 From: whyour Date: Sun, 4 Apr 2021 13:32:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BB=BB=E5=8A=A1=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=E7=8A=B6=E6=80=81=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/defaultProps.tsx | 12 ++++++------ src/layouts/index.tsx | 2 +- src/pages/crontab/index.tsx | 2 +- src/pages/login/index.tsx | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/layouts/defaultProps.tsx b/src/layouts/defaultProps.tsx index 735833ef..8c039d1b 100644 --- a/src/layouts/defaultProps.tsx +++ b/src/layouts/defaultProps.tsx @@ -19,6 +19,12 @@ export default { hideInMenu: true, component: '@/pages/login/index', }, + { + path: '/crontab', + name: '定时任务', + icon: , + component: '@/pages/crontab/index', + }, { path: '/cookie', name: 'Cookie管理', @@ -37,12 +43,6 @@ export default { icon: , component: '@/pages/diy/index', }, - { - path: '/crontab', - name: '定时任务', - icon: , - component: '@/pages/crontab/index', - }, { path: '/diff', name: '对比工具', diff --git a/src/layouts/index.tsx b/src/layouts/index.tsx index 973cea42..8a42056a 100644 --- a/src/layouts/index.tsx +++ b/src/layouts/index.tsx @@ -31,7 +31,7 @@ export default function (props: any) { useEffect(() => { if (props.location.pathname === '/') { - history.push('/cookie'); + history.push('/crontab'); } }, [props.location.pathname]); diff --git a/src/pages/crontab/index.tsx b/src/pages/crontab/index.tsx index 261d72f8..62ba252d 100644 --- a/src/pages/crontab/index.tsx +++ b/src/pages/crontab/index.tsx @@ -31,8 +31,8 @@ import CronModal from './modal'; const { Text } = Typography; enum CrontabStatus { - 'idle', 'running', + 'idle', 'disabled', } diff --git a/src/pages/login/index.tsx b/src/pages/login/index.tsx index 1df59ccb..c8d0ee4d 100644 --- a/src/pages/login/index.tsx +++ b/src/pages/login/index.tsx @@ -20,7 +20,7 @@ const Login = () => { .then((data) => { if (data.code === 200) { localStorage.setItem(config.authKey, data.token); - history.push('/cookie'); + history.push('/crontab'); } else if (data.code === 100) { notification.warn({ message: data.msg, @@ -39,7 +39,7 @@ const Login = () => { useEffect(() => { const isAuth = localStorage.getItem(config.authKey); if (isAuth) { - history.push('/cookie'); + history.push('/crontab'); } }, []);