Files
lingxi/packages/ui/src/notify.ts
T
Stev_Wang 073d210a92 feat(web): 搭建 Web 壳层与 UI 包基线
React 19 + Vite 6 + Router 7 + TanStack Query + Zustand;Semi 二次封装与 Remix 图标统一出口;顶部模块 + 左侧功能菜单布局、Cloud Blue 主题、登录页与 401/403/404/500 页面;请求层含 token 注入、单飞刷新与统一错误提示。
2026-11-02 17:21:16 +08:00

20 lines
600 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { Toast } from '@douyinfe/semi-ui-19';
/** 统一成功提示 */
export function notifySuccess(content: string): void {
Toast.success({ content, duration: 2 });
}
/** 统一错误提示;带 trace_id 时一并展示,便于用户报障(工程规范 04) */
export function notifyError(message: string, traceId?: string): void {
Toast.error({
content:
traceId === undefined || traceId.length === 0 ? message : `${message}(trace: ${traceId})`,
duration: 4,
});
}
export function notifyWarning(content: string): void {
Toast.warning({ content, duration: 3 });
}