From 29ce5e45f146064b9d97ac8e6a9dd6daf89a4b2b Mon Sep 17 00:00:00 2001 From: siujamo Date: Wed, 31 Dec 2025 11:15:08 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BD=BF=E7=94=A8=20useApp=20hook?= =?UTF-8?q?=20=E8=8E=B7=E5=8F=96=20modal=20=E4=B8=8A=E4=B8=8B=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/dashboard-layout/index.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/layouts/dashboard-layout/index.tsx b/src/layouts/dashboard-layout/index.tsx index 5931888..d82943d 100644 --- a/src/layouts/dashboard-layout/index.tsx +++ b/src/layouts/dashboard-layout/index.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useMemo, useState } from "react" import { useNavigate } from "react-router" -import { App, Avatar, Breadcrumb, Dropdown, Layout, Menu, type MenuProps, Modal, Space } from "antd" +import { App, Avatar, Breadcrumb, Dropdown, Layout, Menu, type MenuProps, Space } from "antd" import { DownOutlined } from "@ant-design/icons" import { ApplicationLogo } from "@/components/icon" import { useAppDispatch, useAppSelector } from "@/store" @@ -41,6 +41,7 @@ function transformMenuData(nodes: TreeNode[]): AntMenuItem[] { } export default function DashboardLayout({ children }: { children: React.ReactNode }) { + const { modal } = App.useApp() const user = useAppSelector((store) => store.auth.user!) const dispatch = useAppDispatch() const breadcrumbItems = useAntBreadcrumbs() @@ -48,7 +49,7 @@ export default function DashboardLayout({ children }: { children: React.ReactNod const onLogout = ({ key }: { key: string }) => { if (key == "logout") { - Modal.confirm({ + modal.confirm({ title: "确定要注销吗?", okText: "确定", cancelText: "取消",