Skip to content

Commit 93a92b4

Browse files
committed
chore: update package dependencies and enhance role switching confirmation
- Upgraded @tanstack/react-router to version 1.166.7, i18next to version 25.8.17, @iconify/json to version 2.2.448, and sass-embedded to version 1.98.0 for improved features and compatibility. - Refactored the role switching functionality in UserDropdown to include a confirmation modal, enhancing user experience by prompting users before refreshing the system.
1 parent 48c01eb commit 93a92b4

2 files changed

Lines changed: 16 additions & 11 deletions

File tree

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"@dnd-kit/utilities": "^3.2.2",
2323
"@monaco-editor/react": "^4.7.0",
2424
"@tanstack/react-query": "^5.90.21",
25-
"@tanstack/react-router": "^1.166.3",
25+
"@tanstack/react-router": "^1.166.7",
2626
"@xyflow/react": "^12.10.1",
2727
"@zxcvbn-ts/core": "^3.0.4",
2828
"ahooks": "^3.9.6",
@@ -33,7 +33,7 @@
3333
"dayjs": "^1.11.19",
3434
"echarts": "^6.0.0",
3535
"html-to-image": "^1.11.13",
36-
"i18next": "^25.8.15",
36+
"i18next": "^25.8.17",
3737
"jsencrypt": "^3.5.4",
3838
"keepalive-for-react": "5.0.6",
3939
"lodash-es": "^4.17.23",
@@ -50,11 +50,11 @@
5050
},
5151
"devDependencies": {
5252
"@biomejs/biome": "^2.4.6",
53-
"@iconify/json": "^2.2.447",
53+
"@iconify/json": "^2.2.448",
5454
"@svgr/core": "^8.1.0",
5555
"@svgr/plugin-jsx": "^8.1.0",
5656
"@tailwindcss/vite": "^4.2.1",
57-
"@tanstack/react-router-devtools": "^1.166.3",
57+
"@tanstack/react-router-devtools": "^1.166.7",
5858
"@types/crypto-js": "^4.2.2",
5959
"@types/lodash-es": "^4.17.12",
6060
"@types/node": "^22.19.15",
@@ -64,7 +64,7 @@
6464
"@types/react-resizable": "^3.0.8",
6565
"@vitejs/plugin-react": "^5.1.4",
6666
"babel-plugin-react-compiler": "^1.0.0",
67-
"sass-embedded": "^1.97.3",
67+
"sass-embedded": "^1.98.0",
6868
"tailwindcss": "^4.2.1",
6969
"typescript": "~5.9.3",
7070
"unplugin-icons": "^23.0.1",

src/layouts/Header/component/UserDropdown/index.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,6 @@ const UserDropdown: React.FC = () => {
9696
// 清空当前标签页
9797
resetTabs();
9898

99-
// 显示成功消息
100-
message.success('角色切换成功,页面将刷新');
101-
102-
// 延迟刷新页面,让用户看到成功消息
10399
setTimeout(() => {
104100
window.location.reload();
105101
}, 1000);
@@ -110,9 +106,18 @@ const UserDropdown: React.FC = () => {
110106
},
111107
});
112108

113-
// 角色切换处理
109+
// 角色切换处理:先确认再切换并整体刷新
114110
const handleRoleSwitch = (roleId: string) => {
115-
roleSwitchMutation.mutate(roleId);
111+
modal.confirm({
112+
title: '切换角色',
113+
icon: <ExclamationCircleOutlined />,
114+
content: '切换角色后,系统将整体刷新以加载新角色权限与菜单,是否继续?',
115+
okText: '确定',
116+
cancelText: '取消',
117+
onOk: () => {
118+
roleSwitchMutation.mutate(roleId);
119+
},
120+
});
116121
};
117122

118123
// 菜单栏

0 commit comments

Comments
 (0)