diff --git a/frontend/src/components/welcome/header.tsx b/frontend/src/components/welcome/header.tsx index 3c5fad68..78d7080b 100644 --- a/frontend/src/components/welcome/header.tsx +++ b/frontend/src/components/welcome/header.tsx @@ -1,16 +1,11 @@ import { Button } from "@/components/ui/button" import { cn } from "@/lib/utils"; import { useAuth } from "@/components/auth-provider"; -import { IconMenu2, IconPointFilled } from "@tabler/icons-react"; +import { IconArrowLeft, IconMenu2 } from "@tabler/icons-react"; import React from "react"; import { Link, useLocation } from "react-router-dom"; import { Drawer, DrawerContent, DrawerHeader, DrawerTitle, DrawerTrigger } from "../ui/drawer"; -const navItems = [ - { label: "介绍", to: "/" }, - { label: "广场", to: "/playground" }, -]; - const docsLink = "https://monkeycode.docs.baizhi.cloud/"; const githubLink = "https://github.com/chaitin/MonkeyCode"; @@ -19,9 +14,20 @@ const Header = () => { const [isScrolled, setIsScrolled] = React.useState(false); const location = useLocation(); const isWelcomePage = location.pathname === "/"; + const isLegalPage = location.pathname === "/privacy-policy" || location.pathname === "/user-agreement"; + const isTerminalPage = isWelcomePage || isLegalPage; const isPixelPage = isWelcomePage; const inviterId = typeof window !== "undefined" ? localStorage.getItem('ic') || '' : ''; const signUpLink = "/api/v1/users/login?redirect=&inviter_id=" + inviterId; + const navItems = isLegalPage + ? [ + { label: "隐私政策", to: "/privacy-policy" }, + { label: "用户协议", to: "/user-agreement" }, + ] + : [ + { label: "介绍", to: "/" }, + { label: "广场", to: "/playground" }, + ]; const activeNav = navItems.find((item) => item.to === "/" ? location.pathname === "/" : location.pathname.startsWith(item.to) )?.to; @@ -35,7 +41,7 @@ const Header = () => { return () => window.removeEventListener('scroll', handleScroll); }, []); - if (isWelcomePage) { + if (isTerminalPage) { return (
{
-
- - System Online -
+ {isLegalPage ? ( + + ) : null} {navItems.map((item) => ( - + {!isLegalPage ? ( + + ) : null}
{!isLoggedIn && ( @@ -132,6 +148,15 @@ const Header = () => {
-
- - Build 2.4.1 -
- {!isLoggedIn && ( + + +
+ + + +
+ {!isLoggedIn ? ( + <> + 注册 + + 登录 + + + ) : ( + + 进入控制台 + + )} +
+ + {menuOpen ? ( +
+
+ + System Online +
+ +
+ {!isLoggedIn ? ( + <> + 注册 + + 登录 + + + ) : ( + + 进入控制台 + + )} +
+
+ ) : null} +
+
+ ); +} + +export function TerminalFooter() { + return ( + + ); +} diff --git a/frontend/src/components/welcome/terminal-native-page.tsx b/frontend/src/components/welcome/terminal-native-page.tsx index 0c3910d3..b86510e5 100644 --- a/frontend/src/components/welcome/terminal-native-page.tsx +++ b/frontend/src/components/welcome/terminal-native-page.tsx @@ -2,17 +2,13 @@ import { useAuth } from "@/components/auth-provider"; import Icon from "@/components/common/Icon"; import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip"; import { cn } from "@/lib/utils"; -import { IconArrowRight, IconFile, IconFilePencil, IconFolder, IconFolderOpen, IconMenu2, IconPointFilled, IconSend } from "@tabler/icons-react"; +import { IconArrowRight, IconFile, IconFilePencil, IconFolder, IconFolderOpen, IconSend } from "@tabler/icons-react"; import React from "react"; import { Link } from "react-router-dom"; +import { TerminalFooter, TerminalHeader } from "./terminal-chrome"; -const DOCS_LINK = "https://monkeycode.docs.baizhi.cloud/"; const GITHUB_LINK = "https://github.com/chaitin/MonkeyCode/"; -const FORUM_LINK = "https://bbs.baizhi.cloud/"; -const MODEL_SQUARE_LINK = "https://baizhi.cloud/landing/model-square"; const CONSULT_LINK = "https://baizhi.cloud/consult"; -const CHAITIN_LINK = "https://www.chaitin.cn/"; -const BAIZHI_LINK = "https://www.baizhi.cloud/"; const themeVars = { "--a-bg": "#0a0d0a", @@ -32,14 +28,6 @@ const themeVars = { "--a-purple": "#c39bff", } as React.CSSProperties; -const pageNav = [ - { label: "介绍", href: "#hero" }, - { label: "特色", href: "#features" }, - { label: "场景", href: "#usecases" }, - { label: "套餐", href: "#pricing" }, - { label: "文档", href: DOCS_LINK, external: true }, -]; - const featureItems = [ { key: "01", @@ -248,26 +236,6 @@ const faqItems = [ }, ]; -const resourceLinks = [ - { title: "产品文档", href: DOCS_LINK }, - { title: "技术论坛", href: FORUM_LINK }, - { title: "开源仓库", href: GITHUB_LINK }, - { title: "模型广场", href: MODEL_SQUARE_LINK }, -]; - -const aboutLinks = [ - { title: "长亭科技", href: CHAITIN_LINK }, - { title: "长亭百智云", href: BAIZHI_LINK }, - { title: "隐私政策", href: "/privacy-policy" }, - { title: "用户协议", href: "/user-agreement" }, -]; - -const communityCards = [ - { label: "微信群", src: "/wechat.png", alt: "微信二维码" }, - { label: "飞书群", src: "/feishu.png", alt: "飞书群二维码" }, - { label: "钉钉群", src: "/dingtalk.png", alt: "钉钉群二维码" }, -]; - type HeroFileTreeItem = { name: string; type: "folder" | "file"; @@ -293,38 +261,6 @@ const heroFileTree: HeroFileTreeItem[] = [ { name: "README.md", type: "file" }, ]; -function LogoMark({ - size = 28, - color = "currentColor", - accent = "currentColor", -}: { - size?: number; - color?: string; - accent?: string; -}) { - return ( - - ); -} - -function LogoWordmark() { - return ( -
- - - MonkeyCode - -
- ); -} - function SectionShell({ id, index, @@ -419,36 +355,9 @@ function HeaderAction({ ); } -function FooterLinkItem({ title, href }: { title: string; href: string }) { - if (href.startsWith("/")) { - return ( - - {title} - - ); - } - - return ( - - {title} - - ); -} - export default function TerminalNativePage() { const { isLoggedIn } = useAuth(); - const [isScrolled, setIsScrolled] = React.useState(false); - const [menuOpen, setMenuOpen] = React.useState(false); const [openFaq, setOpenFaq] = React.useState(0); - const inviterId = typeof window !== "undefined" ? localStorage.getItem("ic") || "" : ""; - const signUpLink = `/api/v1/users/login?redirect=&inviter_id=${inviterId}`; - - React.useEffect(() => { - const handleScroll = () => setIsScrolled(window.scrollY > 4); - handleScroll(); - window.addEventListener("scroll", handleScroll); - return () => window.removeEventListener("scroll", handleScroll); - }, []); return (
-
-
-
- - - - - -
- - - -
- {!isLoggedIn ? ( - <> - 注册 - - 登录 - - - ) : ( - - 进入控制台 → - - )} -
- - {menuOpen ? ( -
-
- - System Online -
-
- {pageNav.map((item) => - item.external ? ( - setMenuOpen(false)} - className="rounded-[4px] border border-[var(--a-line)] px-4 py-3 text-sm text-[var(--a-fg)] transition-colors hover:bg-[#162019]" - > - {item.label} - - ) : ( - setMenuOpen(false)} - className="rounded-[4px] border border-[var(--a-line)] px-4 py-3 text-sm text-[var(--a-fg)] transition-colors hover:bg-[#162019]" - > - {item.label} - - ) - )} -
-
- {!isLoggedIn ? ( - <> - 注册 - - 登录 - - - ) : ( - - 进入控制台 → - - )} -
-
- ) : null} -
-
+
@@ -983,51 +783,7 @@ export default function TerminalNativePage() {
- + ); } diff --git a/frontend/src/pages/login.tsx b/frontend/src/pages/login.tsx index c4fd4136..67ea66e0 100644 --- a/frontend/src/pages/login.tsx +++ b/frontend/src/pages/login.tsx @@ -9,6 +9,7 @@ import { FieldGroup, FieldLabel, } from "@/components/ui/field" +import { Checkbox } from "@/components/ui/checkbox" import { Input } from "@/components/ui/input" import { Tabs, @@ -39,10 +40,17 @@ export default function LoginPage({ const [showUserPassword, setShowUserPassword] = React.useState(false) const [showManagerPassword, setShowManagerPassword] = React.useState(false) const [userLoginView, setUserLoginView] = React.useState<'choices' | 'password'>('choices') + const [agreedToTerms, setAgreedToTerms] = React.useState(true) const navigate = useNavigate() const inviterId = typeof window !== 'undefined' ? (localStorage.getItem('ic') || '') : '' const userLoginHref = `/api/v1/users/login?redirect=&inviter_id=${inviterId}` + const ensureTermsAccepted = React.useCallback(() => { + if (agreedToTerms) return true + toast.error('请先阅读并同意用户协议') + return false + }, [agreedToTerms]) + React.useEffect(() => { try { const savedUser = localStorage.getItem(USER_STORAGE_KEY) @@ -63,6 +71,8 @@ export default function LoginPage({ }, []) const handleUserLogin = async () => { + if (!ensureTermsAccepted()) return + if (userEmail.trim() === '' || userPassword.trim() === '') { toast.error('请输入账号和密码') return @@ -91,6 +101,8 @@ export default function LoginPage({ } const handleTeamManagerLogin = async () => { + if (!ensureTermsAccepted()) return + if (teamManagerEmail.trim() === '' || teamManagerPassword.trim() === '') { toast.error('请输入账号和密码') return @@ -140,7 +152,16 @@ export default function LoginPage({
选择登录方式
) : ( @@ -207,7 +237,7 @@ export default function LoginPage({ - @@ -256,7 +286,7 @@ export default function LoginPage({ - @@ -265,6 +295,21 @@ export default function LoginPage({ +
+ setAgreedToTerms(checked === true)} + className="mt-0.5" + /> + +
diff --git a/frontend/src/pages/privacy-policy.tsx b/frontend/src/pages/privacy-policy.tsx index 1e416891..e0f62b83 100644 --- a/frontend/src/pages/privacy-policy.tsx +++ b/frontend/src/pages/privacy-policy.tsx @@ -1,8 +1,7 @@ -import { AuthProvider } from "@/components/auth-provider" -import Footer from "@/components/welcome/footer" -import Header from "@/components/welcome/header" +import { AuthProvider } from "@/components/auth-provider"; +import LegalTerminalPage, { type LegalSection } from "@/components/welcome/legal-terminal-page"; -const sections = [ +const sections: LegalSection[] = [ { id: "collection", title: "我们可能收集的信息", @@ -88,95 +87,33 @@ const sections = [ content: [ "如您对本隐私政策或个人信息处理事项有任何疑问、意见或投诉建议,可通过官方渠道与我们联系。", ], + footer: ( + <> + 官方渠道: + + 长亭科技官网 + + {" "}或{" "} + + 长亭百智云官网 + + 。 + + ), }, -] +]; export default function PrivacyPolicyPage() { return ( -
-
-
-
-
- MonkeyCode Logo - MonkeyCode 智能开发平台 -
-

隐私政策

-

- 我们重视您的个人信息与数据安全。本页面用于说明 MonkeyCode 智能开发平台在提供产品与服务过程中,如何收集、使用、存储、共享和保护与您相关的信息,以及您可以如何管理这些信息。 -

-
- 适用于官网与控制台服务 - 最近更新:2026-03-24 - 建议定期查看更新内容 -
-
- -
- - -
- {sections.map((section, index) => ( -
- - Section {index + 1} - -

{section.title}

- {section.content?.map((paragraph) => ( -

- {paragraph} -

- ))} - {section.items ? ( -
    - {section.items.map((item) => ( -
  • {item}
  • - ))} -
- ) : null} - {section.note ? ( -
- {section.note} -
- ) : null} - {section.id === "contact" ? ( -

- 官方渠道: - - 长亭科技官网 - - {' '}或{' '} - - 长亭百智云官网 - - 。 -

- ) : null} -
- ))} -
-
-
-
-
+
- ) + ); } diff --git a/frontend/src/pages/user-agreement.tsx b/frontend/src/pages/user-agreement.tsx index ac37e901..5705a2f5 100644 --- a/frontend/src/pages/user-agreement.tsx +++ b/frontend/src/pages/user-agreement.tsx @@ -1,8 +1,7 @@ -import { AuthProvider } from "@/components/auth-provider" -import Footer from "@/components/welcome/footer" -import Header from "@/components/welcome/header" +import { AuthProvider } from "@/components/auth-provider"; +import LegalTerminalPage, { type LegalSection } from "@/components/welcome/legal-terminal-page"; -const sections = [ +const sections: LegalSection[] = [ { id: "scope", title: "协议适用范围", @@ -19,6 +18,7 @@ const sections = [ "您应妥善保管账号、密码及登录凭证,并对账号下的行为承担相应责任。", "未经平台书面许可,您不得出租、出借、转让或售卖账号。", "如发现账号异常、被盗用或存在安全风险,应及时通知平台。", + "账号仅限在合法、合规且经平台授权的范围内使用;如账号被用于违规、滥用、攻击、刷量或其他恶意目的,平台有权对账号采取限制、冻结或封禁等措施。", ], }, { @@ -40,6 +40,10 @@ const sections = [ "攻击、干扰、绕过或破坏平台系统、接口、安全机制或服务稳定性。", "利用平台从事未经授权的数据抓取、作弊刷量、恶意调用或其他不正当行为。", "侵犯他人的知识产权、商业秘密、个人信息或其他合法权益。", + "利用 MonkeyCode 制造、传播或协助开发带有网络攻击、入侵破坏、恶意控制、漏洞利用等性质的软件、脚本或工具。", + "直接使用 MonkeyCode 或借助平台生成内容发起网络攻击、渗透破坏、恶意扫描、批量漏洞利用、拒绝服务攻击或其他危害网络与信息系统安全的行为。", + "以盗取、冒用、转售、共享、绕过限制或其他未经授权的方式使用 MonkeyCode 的 API Token、账号能力或平台资源,并将其提供给其他 AI 工具、脚本、服务或第三方继续调用。", + "通过批量注册、伪造身份、作弊邀请、脚本刷量、异常设备或其他恶意方式套取、盗刷、骗取邀请注册积分、活动奖励、补贴或其他平台权益。", ], }, { @@ -72,9 +76,14 @@ const sections = [ { id: "termination", title: "协议终止与违约处理", + content: [ + "为保障平台、其他用户及第三方的安全与合法权益,如用户存在违规使用账号的情形,平台有权依据违规性质、影响范围和风险程度采取相应处置措施。", + ], items: [ "如您违反本协议或相关规则,平台有权视情节采取警示、限制功能、暂停服务、封禁账号等措施。", "您可依据平台提供的路径停止使用相关服务;账号注销后,平台将按规则处理相关数据。", + "如平台认定您存在违规、滥用、欺诈、攻击、盗用资源或其他危害平台、用户或第三方安全与权益的行为,平台有权在不事先通知的情况下,对相关账号采取临时限制、永久封禁、冻结权益、清除异常奖励、终止服务等处理措施,并保留追究法律责任的权利。", + "前述可导致封号或其他处置的行为,包括但不限于:使用 MonkeyCode 制造带有网络攻击性质的软件,直接使用 MonkeyCode 发起网络攻击,盗取或冒用 MonkeyCode API Token 供其他 AI 工具继续调用,以及通过批量注册、作弊邀请、脚本刷量等恶意行为盗刷邀请注册积分或其他平台权益。", ], }, { @@ -83,90 +92,33 @@ const sections = [ content: [ "若您对本协议有任何疑问、建议或投诉,可通过官方渠道与我们联系。", ], + footer: ( + <> + 官方渠道: + + 长亭科技官网 + + {" "}或{" "} + + 长亭百智云官网 + + 。 + + ), }, -] +]; export default function UserAgreementPage() { return ( -
-
-
-
-
- MonkeyCode Logo - MonkeyCode 智能开发平台 -
-

用户协议

-

- 本协议用于说明您在使用 MonkeyCode 智能开发平台及相关服务时应遵守的规则,以及平台与您之间的权利义务关系。请在使用前认真阅读。 -

-
- 适用于官网与控制台服务 - 最近更新:2026-03-24 - 使用服务即视为同意本协议 -
-
- -
- - -
- {sections.map((section, index) => ( -
- - Section {index + 1} - -

{section.title}

- {section.content?.map((paragraph) => ( -

- {paragraph} -

- ))} - {section.items ? ( -
    - {section.items.map((item) => ( -
  • {item}
  • - ))} -
- ) : null} - {section.id === "contact" ? ( -

- 官方渠道: - - 长亭科技官网 - - {' '}或{' '} - - 长亭百智云官网 - - 。 -

- ) : null} -
- ))} -
-
-
-
-
+
- ) + ); }