🔗 友情链接登记

需包含 http:// 或 https://
用于审核联系,不公开显示

获取友情链接列表

GET /api/links
获取已审核通过的友情链接列表
查询参数:
• category - 按分类筛选
• exclude - 排除指定名称(逗号分隔)
• excludeId - 排除指定ID(逗号分隔)
• limit - 返回数量(默认100,最大500)
• offset - 分页偏移
{
  "success": true,
  "data": {
    "list": [
      {
        "id": 1,
        "url": "https://example.com",
        "name": "示例网站",
        "author": "作者名",
        "category": "技术"
      }
    ],
    "total": 1
  }
}

获取分类列表

GET /api/categories
获取所有网站分类
curl "https://friendlink.xiaofei.icu/api/categories"
fetch('https://friendlink.xiaofei.icu/api/categories')
  .then(res => res.json())
  .then(data => console.log(data));
axios.get('https://friendlink.xiaofei.icu/api/categories')
  .then(res => console.log(res.data));
{
  "success": true,
  "data": [
    { "id": 1, "name": "技术" },
    { "id": 2, "name": "博客" }
  ]
}
⚠️ 说明
以上两个接口支持跨域调用,可用于在其他网站展示友情链接。
其他接口(提交、管理等)仅限本站使用,不支持跨域。