From 8616e2ab34f9d62e2847ac5d9ce441e1688a4b99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8C=97=E6=9E=B3?= <7854742+wang_rumeng@user.noreply.gitee.com> Date: Mon, 1 Sep 2025 21:53:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9E=84=E5=BB=BA=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/message.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/utils/message.tsx b/utils/message.tsx index 6ba9e86..ceb89cd 100644 --- a/utils/message.tsx +++ b/utils/message.tsx @@ -1,5 +1,5 @@ import { message } from 'antd'; -import type { MessageArgsProps } from 'antd/es/message'; +import type { ArgsProps as MessageProps } from 'antd/es/message'; /** * 全局消息提示工具 @@ -12,7 +12,7 @@ class MessageUtil { * @param duration - 显示时长(秒),默认 3 秒 * @param options - 其他配置项 */ - success(content: string, duration = 3, options?: Omit) { + success(content: string, duration = 3, options?: Omit) { message.success({ content, duration, ...options }); } @@ -22,7 +22,7 @@ class MessageUtil { * @param duration - 显示时长(秒),默认 3 秒 * @param options - 其他配置项 */ - error(content: string, duration = 3, options?: Omit) { + error(content: string, duration = 3, options?: Omit) { message.error({ content, duration, ...options }); } @@ -32,7 +32,7 @@ class MessageUtil { * @param duration - 显示时长(秒),默认 3 秒 * @param options - 其他配置项 */ - warning(content: string, duration = 3, options?: Omit) { + warning(content: string, duration = 3, options?: Omit) { message.warning({ content, duration, ...options }); } @@ -42,7 +42,7 @@ class MessageUtil { * @param duration - 显示时长(秒),默认 3 秒 * @param options - 其他配置项 */ - info(content: string, duration = 3, options?: Omit) { + info(content: string, duration = 3, options?: Omit) { message.info({ content, duration, ...options }); } @@ -53,7 +53,7 @@ class MessageUtil { * @param options - 其他配置项 * @returns - 返回一个函数,调用该函数可以手动关闭提示 */ - loading(content: string, duration = 0, options?: Omit) { + loading(content: string, duration = 0, options?: Omit) { return message.loading({ content, duration, ...options }); } @@ -68,7 +68,7 @@ class MessageUtil { * 配置全局默认值 * @param options - 全局配置项 */ - config(options: MessageArgsProps) { + config(options: MessageProps) { message.config(options); } }