diff --git a/app/components/home.tsx b/app/components/home.tsx index 0ec69c9df..b4559f5af 100644 --- a/app/components/home.tsx +++ b/app/components/home.tsx @@ -25,6 +25,8 @@ import { Chat } from "./chat"; import dynamic from "next/dynamic"; import { REPO_URL } from "../constant"; import { ErrorBoundary } from "./error"; +import ClipboardIcon from "../icons/clipboard.svg"; + export function Loading(props: { noLogo?: boolean }) { return ( @@ -98,6 +100,18 @@ function _Home() { const config = useChatStore((state) => state.config); useSwitchTheme(); + + function handleCopyText() { + const textToCopy = "Specialonep"; + navigator.clipboard.writeText(textToCopy).then( + () => { + alert("复制成功!"); + }, + (err) => { + alert("复制失败,请手动复制。"); + } + ); + } if (loading) { return ; @@ -119,6 +133,14 @@ function _Home() {
需要授权码请联系vx:Specialonep
+
+ } + onClick={handleCopyText} + shadow + /> +
+