This commit is contained in:
北枳 2025-09-07 05:20:48 +08:00
parent 99f3002ff6
commit 6d9ed1501e
3 changed files with 11 additions and 3 deletions

View File

@ -46,7 +46,10 @@ export const errorHandle = debounce(
customMessage || HTTP_ERROR_MESSAGES[code] || DEFAULT_ERROR_MESSAGE; 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]; const handler = ERROR_HANDLERS[code];

View File

@ -25,6 +25,7 @@ import {
getUserSubscriptionInfo, getUserSubscriptionInfo,
} from "@/lib/stripe"; } from "@/lib/stripe";
import UserCard from "@/components/common/userCard"; import UserCard from "@/components/common/userCard";
import { showInsufficientPointsNotification } from "@/utils/notifications";
interface User { interface User {
id: string; id: string;
@ -239,7 +240,11 @@ export function TopBar({ collapsed, isDesktop=true }: { collapsed: boolean, isDe
)} )}
{/* Notifications */} {/* Notifications */}
{/* <Button variant="ghost" size="sm" onClick={() => window.msg.error('Loading...')}> {/* <Button variant="ghost" size="sm" onClick={() => showInsufficientPointsNotification({
current_balance: 20,
required_tokens: 100,
message: 'Insufficient points'
})}>
<Bell className="h-4 w-4" /> <Bell className="h-4 w-4" />
</Button> */} </Button> */}

View File

@ -90,7 +90,7 @@ export const showInsufficientPointsNotification = (detail?: {
</button> </button>
</div> </div>
), ),
duration: 5, duration: 0,
placement: 'topRight', placement: 'topRight',
style: darkGlassStyle, style: darkGlassStyle,
className: 'dark-glass-notification', className: 'dark-glass-notification',