diff --git a/api/errorHandle.ts b/api/errorHandle.ts index fba0ba5..67172c8 100644 --- a/api/errorHandle.ts +++ b/api/errorHandle.ts @@ -46,7 +46,10 @@ export const errorHandle = debounce( customMessage || HTTP_ERROR_MESSAGES[code] || DEFAULT_ERROR_MESSAGE; // 显示错误提示 - window.msg.error(errorMessage); + // 402 状态码 不需要显示提示 + if (code !== 402) { + window.msg.error(errorMessage); + } // 执行特殊错误码的处理函数 const handler = ERROR_HANDLERS[code]; diff --git a/components/layout/top-bar.tsx b/components/layout/top-bar.tsx index 7f60d92..2516a30 100644 --- a/components/layout/top-bar.tsx +++ b/components/layout/top-bar.tsx @@ -25,6 +25,7 @@ import { getUserSubscriptionInfo, } from "@/lib/stripe"; import UserCard from "@/components/common/userCard"; +import { showInsufficientPointsNotification } from "@/utils/notifications"; interface User { id: string; @@ -239,7 +240,11 @@ export function TopBar({ collapsed, isDesktop=true }: { collapsed: boolean, isDe )} {/* Notifications */} - {/* */} diff --git a/utils/notifications.tsx b/utils/notifications.tsx index d7dda08..db8e313 100644 --- a/utils/notifications.tsx +++ b/utils/notifications.tsx @@ -90,7 +90,7 @@ export const showInsufficientPointsNotification = (detail?: { ), - duration: 5, + duration: 0, placement: 'topRight', style: darkGlassStyle, className: 'dark-glass-notification',