Your Name e4959d584f feat: 完善代理商端业务逻辑与前后端框架
主要更新:
- 更新代理商端文档,明确项目由品牌方分配流程
- 新增Brief配置详情页(已配置)设计稿
- 完善工作台紧急待办中品牌新任务功能
- 整理Pencil设计文件中代理商端页面顺序
- 新增后端FastAPI框架及核心API
- 新增前端Next.js页面和组件库
- 添加.gitignore排除构建和缓存文件

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 19:27:31 +08:00

97 lines
3.4 KiB
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.

'use client'
import { useEffect } from 'react'
import { useRouter } from 'next/navigation'
import Link from 'next/link'
import { useAuth } from '@/contexts/AuthContext'
import { ShieldCheck, ArrowRight } from 'lucide-react'
export default function HomePage() {
const router = useRouter()
const { user, isAuthenticated, isLoading } = useAuth()
useEffect(() => {
if (!isLoading && isAuthenticated && user) {
switch (user.role) {
case 'creator':
router.push('/creator')
break
case 'agency':
router.push('/agency')
break
case 'brand':
router.push('/brand')
break
}
}
}, [isLoading, isAuthenticated, user, router])
if (isLoading) {
return (
<div className="min-h-screen flex items-center justify-center bg-bg-page">
<div className="w-8 h-8 border-2 border-accent-indigo border-t-transparent rounded-full animate-spin" />
</div>
)
}
return (
<div className="min-h-screen bg-bg-page flex flex-col items-center justify-center px-6">
<div className="text-center space-y-8 max-w-md">
{/* Logo */}
<div className="flex items-center justify-center gap-3">
<div className="w-12 h-12 rounded-xl bg-gradient-to-br from-accent-indigo to-[#4F46E5] flex items-center justify-center shadow-[0px_8px_24px_-4px_rgba(99,102,241,0.4)]">
<ShieldCheck className="w-7 h-7 text-white" />
</div>
<span className="text-3xl font-bold text-text-primary"></span>
</div>
{/* Title */}
<div className="space-y-3">
<h1 className="text-2xl font-bold text-text-primary">
AI
</h1>
<p className="text-text-secondary">
AI
</p>
</div>
{/* Login Button */}
<div className="pt-4">
<Link
href="/login"
className="inline-flex items-center gap-2 px-8 py-4 rounded-xl bg-gradient-to-r from-accent-indigo to-[#4F46E5] text-white font-semibold text-lg shadow-[0px_8px_24px_-4px_rgba(99,102,241,0.4)] hover:opacity-90 transition-opacity"
>
<ArrowRight className="w-5 h-5" />
</Link>
</div>
{/* Role Selection */}
<div className="pt-6 border-t border-border-subtle">
<p className="text-sm text-text-tertiary mb-4"></p>
<div className="flex flex-col sm:flex-row gap-3 justify-center">
<Link
href="/login?role=creator"
className="px-6 py-3 rounded-xl bg-bg-card border border-border-subtle text-text-secondary font-medium hover:bg-bg-elevated transition-colors"
>
</Link>
<Link
href="/login?role=agency"
className="px-6 py-3 rounded-xl bg-bg-card border border-border-subtle text-text-secondary font-medium hover:bg-bg-elevated transition-colors"
>
</Link>
<Link
href="/login?role=brand"
className="px-6 py-3 rounded-xl bg-bg-card border border-border-subtle text-text-secondary font-medium hover:bg-bg-elevated transition-colors"
>
</Link>
</div>
</div>
</div>
</div>
)
}