+
{isAuthenticated ? (
{
- profileCenter.setIsRechargeOpen(true);
- profileCenter.loadRechargeCenter();
- }}
+ onRecharge={openRecharge}
onOpenLedger={profileCenter.openWalletLedgerPanel}
/>
- ) : (
- authUi?.openLoginModal()}
+ ) : null}
+
- )}
-
- }
- onClick={() => {
- if (isAuthenticated) {
- authUi?.openAccountModal();
- return;
- }
- authUi?.openLoginModal();
- }}
- />
- }
- onClick={() => authUi?.openSettingsModal()}
- />
+ {avatarUrl ? (
+
+ ) : (
+ avatarLabel
+ )}
+
+
+
+ {authUi?.user?.displayName || '登录'}
+
+
+ {authUi?.user ? publicUserCode : '账号入口'}
+
+
+
@@ -312,7 +357,20 @@ export function PlatformEntryFlowShellImpl({
id={isCreationStage ? 'platform-tab-panel-create' : undefined}
className={`platform-tab-panel min-h-0 min-w-0 flex-1 overflow-auto ${isCreationStage ? '' : 'px-3 py-4 sm:px-6 sm:py-6'}`}
>
- {isCreationStage ? (
+ {isProfileStage ? (
+
authUi?.openLoginModal()}
+ onOpenAccount={() => authUi?.openAccountModal()}
+ onOpenRecharge={openRecharge}
+ onOpenSettings={() => authUi?.openSettingsModal()}
+ onOpenWalletLedger={
+ profileCenter.openWalletLedgerPanel
+ }
+ />
+ ) : isCreationStage ? (
}
>
diff --git a/src/components/platform-entry/platformActiveProfileModel.ts b/src/components/platform-entry/platformActiveProfileModel.ts
new file mode 100644
index 000000000..6bf73fd83
--- /dev/null
+++ b/src/components/platform-entry/platformActiveProfileModel.ts
@@ -0,0 +1,19 @@
+import type { AuthUser } from '../../../packages/shared/src/contracts/auth';
+
+export function resolveActivePublicUserCode(
+ user: AuthUser | null | undefined,
+) {
+ if (user?.publicUserCode?.trim()) {
+ return user.publicUserCode.trim();
+ }
+
+ const raw =
+ user?.id.replace(/[^a-zA-Z0-9]/gu, '').toUpperCase() || '00000000';
+ return `SY-${raw.slice(-8).padStart(8, '0')}`;
+}
+
+export function resolveActiveUserAvatarLabel(
+ user: AuthUser | null | undefined,
+) {
+ return (user?.displayName || '叙').slice(0, 1).toUpperCase();
+}
diff --git a/tsconfig.typecheck-guardrails.json b/tsconfig.typecheck-guardrails.json
index 150dc4429..8fc9ddeba 100644
--- a/tsconfig.typecheck-guardrails.json
+++ b/tsconfig.typecheck-guardrails.json
@@ -22,6 +22,8 @@
"src/components/image-editor/**/*.test.tsx",
"src/components/project/**/*.test.ts",
"src/components/project/**/*.test.tsx",
+ "src/components/platform-entry/PlatformActiveProfileView.test.tsx",
+ "src/components/platform-entry/PlatformEntryActiveFlowShell.test.tsx",
"src/services/image-editor/**/*.test.ts",
"src/services/image-editor/**/*.test.tsx",
"src/services/external-generation/**/*.test.ts",
diff --git a/vite.config.ts b/vite.config.ts
index 95a3528b6..9fb329b3a 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -20,6 +20,8 @@ const ACTIVE_TAILWIND_SOURCES = `@import 'tailwindcss' source(none);
@source "./components/project";
@source "./components/platform-entry/PlatformEntryFlowShell.tsx";
@source "./components/platform-entry/PlatformEntryActiveFlowShell.tsx";
+@source "./components/platform-entry/PlatformActiveProfileView.tsx";
+@source "./components/platform-entry/PlatformProfilePrimitives.tsx";
@source "./components/platform-entry/PlatformProfileModalShell.tsx";
@source "./components/platform-entry/PlatformProfileRechargeModal.tsx";
@source "./components/platform-entry/PlatformProfileWalletLedgerModal.tsx";
diff --git a/vitest.config.ts b/vitest.config.ts
index a60339bb7..9341167bf 100644
--- a/vitest.config.ts
+++ b/vitest.config.ts
@@ -32,6 +32,8 @@ export default defineConfig({
'src/components/image-editor/**/*.test.tsx',
'src/components/project/**/*.test.ts',
'src/components/project/**/*.test.tsx',
+ 'src/components/platform-entry/PlatformActiveProfileView.test.tsx',
+ 'src/components/platform-entry/PlatformEntryActiveFlowShell.test.tsx',
'src/components/platform-entry/PlatformProfileModalShell.test.tsx',
'src/components/platform-entry/PlatformProfileQrScannerModal.test.tsx',
'src/components/platform-entry/PlatformProfileRechargeModal.test.tsx',