diff --git a/web/src/components/CopyButton.tsx b/web/src/components/CopyButton.tsx new file mode 100644 index 0000000..8e5ee8f --- /dev/null +++ b/web/src/components/CopyButton.tsx @@ -0,0 +1,35 @@ +import { useState } from 'react' + +interface CopyButtonProps { + text: string + label?: string +} + +export default function CopyButton({ text, label = '复制' }: CopyButtonProps) { + const [copied, setCopied] = useState(false) + + const handleCopy = async () => { + await navigator.clipboard.writeText(text) + setCopied(true) + setTimeout(() => setCopied(false), 2000) + } + + return ( + + ) +} \ No newline at end of file diff --git a/web/src/components/Layout.tsx b/web/src/components/Layout.tsx new file mode 100644 index 0000000..4edd369 --- /dev/null +++ b/web/src/components/Layout.tsx @@ -0,0 +1,56 @@ +import { ReactNode } from 'react' +import { Link, useLocation } from 'react-router-dom' + +interface LayoutProps { + children: ReactNode + token: string | null + onLogout: () => void +} + +export default function Layout({ children, token, onLogout }: LayoutProps) { + const location = useLocation() + + const navItems = [ + { path: '/', label: '控制台', icon: '📊' }, + { path: '/test', label: '测试', icon: '🧪' }, + { path: '/docs', label: '文档', icon: '📚' }, + ] + + if (!token) return null + + return ( +
暂无注册码,点击上方按钮生成
- ) : ( -| 注册码 | -积分 | -状态 | +||
|---|---|---|---|---|
| ID | +用户名 | +角色 | +余额 | +注册时间 |
| {code.code} | -{code.points} | -- {code.is_used ? '已使用' : '未使用'} + {users.map(user => ( + | ||
| {user.id} | +{user.username} | ++ + {user.role} + | +{user.balance.toLocaleString()} | +{new Date(user.created_at).toLocaleDateString()} |
- 使用以下接口进行验证码识别,需要在请求头中携带 Authorization: Bearer {token.substring(0, 20)}... -
- -
- POST /api/ocr - OCR 文字识别
- POST /api/slider/match - 滑块缺口匹配
- POST /api/compare/similarity - 图片相似度对比
- POST /api/rotate/single/rotate - 单图旋转验证码
- POST /api/detection/icon - 图标检测
+
+ 📡
+
+ API 接口
+ 使用以下接口进行验证码识别
+
+
+
+
+ {apiEndpoints.map((api, i) => (
+
+ {api.method}{' '}
+ {api.path}{' '}
+ // {api.desc}
+
+ ))}
- 请联系管理员获取更多信息 -
+ {/* Features */} +- 步骤 {step} / 3 -
+首次使用需要进行初始化配置
+