Files
superDreamFront/frontend/src/pages/dashboard/Wallet.tsx
xuyong 35c0b7de16 integrate sub2api as upstream for auth/keys/usage via FastAPI BFF
Preserve local user table for superDream-specific features while syncing
user lifecycle, API key CRUD and usage queries through sub2api. Admin token
handles reads and user lifecycle; per-user tokens (Fernet-encrypted in DB)
handle key writes that admin endpoints do not expose.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 21:23:08 +08:00

27 lines
947 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 { useState, useEffect } from "react";
import { authService, UserInfo } from "../../services/authService";
export default function Wallet() {
const [user, setUser] = useState<UserInfo | null>(null);
useEffect(() => {
authService.me().then(setUser).catch(() => {});
}, []);
return (
<div>
<h2 className="text-xl font-bold text-gray-900 dark:text-white mb-4"></h2>
<div className="bg-superdream-panel rounded-xl p-6 mb-4">
<p className="text-gray-600 dark:text-gray-400 text-sm"> (USD)</p>
<p className="text-3xl font-bold text-gray-900 dark:text-white mt-1">
${(user?.balance ?? 0).toFixed(4)}
</p>
</div>
<div className="bg-superdream-panel rounded-xl p-4 text-sm text-gray-600 dark:text-gray-400">
sub2api <code>/api/v1/redeem</code>
</div>
</div>
);
}