From f2fc249d04d36fde79b326e903709a24d98d55c3 Mon Sep 17 00:00:00 2001
From: gaoziman <2942894660@qq.com>
Date: Thu, 6 Nov 2025 00:43:22 +0800
Subject: [PATCH] =?UTF-8?q?refactor(=E5=AF=BC=E8=88=AA):=20=E4=BC=98?=
=?UTF-8?q?=E5=8C=96=E5=AF=BC=E8=88=AA=E7=BB=93=E6=9E=84=E5=92=8C=E9=85=8D?=
=?UTF-8?q?=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 简化路由配置,添加用户信息路由
- 简化NavBar用户下拉菜单,仅保留个人信息和退出登录
- 更新国际化配置,添加用户管理相关翻译
- 优化Settings主题色配置模块
---
src/components/NavBar/index.tsx | 58 ++++---------------------------
src/components/Settings/color.tsx | 20 +++++------
src/locale/index.ts | 14 ++++----
src/routes.ts | 21 +++--------
4 files changed, 26 insertions(+), 87 deletions(-)
diff --git a/src/components/NavBar/index.tsx b/src/components/NavBar/index.tsx
index 41a4210..1afe766 100644
--- a/src/components/NavBar/index.tsx
+++ b/src/components/NavBar/index.tsx
@@ -18,13 +18,10 @@ import {
IconUser,
IconSettings,
IconPoweroff,
- IconExperiment,
- IconDashboard,
- IconInteraction,
- IconTag,
IconLoading,
} from '@arco-design/web-react/icon';
import { useSelector, useDispatch } from 'react-redux';
+import { useHistory } from 'react-router-dom';
import { GlobalState } from '@/store';
import { GlobalContext } from '@/context';
import useLocale from '@/utils/useLocale';
@@ -39,6 +36,7 @@ import { generatePermission } from '@/routes';
function Navbar({ show }: { show: boolean }) {
const t = useLocale();
+ const history = useHistory();
const { userInfo, userLoading } = useSelector((state: GlobalState) => state);
const dispatch = useDispatch();
@@ -55,8 +53,8 @@ function Navbar({ show }: { show: boolean }) {
function onMenuItemClick(key) {
if (key === 'logout') {
logout();
- } else {
- Message.info(`You clicked ${key}`);
+ } else if (key === 'userInfo') {
+ history.push('/user-info');
}
}
@@ -84,54 +82,12 @@ function Navbar({ show }: { show: boolean }) {
);
}
- const handleChangeRole = () => {
- const newRole = role === 'admin' ? 'user' : 'admin';
- setRole(newRole);
- };
-
const droplist = (