迁移文档并更新引用链接
This commit is contained in:
9
src/app/(home)/docs/android-proxy/page.mdx
Normal file
9
src/app/(home)/docs/android-proxy/page.mdx
Normal file
@@ -0,0 +1,9 @@
|
||||
# 安卓手机设置代理教程
|
||||
|
||||
1、打开设置,进入WLAN
|
||||
|
||||
2、选择已连接的WIFI网络,点小箭头进入设置页面
|
||||
|
||||
3、将代理设置为"手动",填写主机名,端口信息,点击右上角保存
|
||||
|
||||
4、打开手机浏览器搜索IP地址查询,若查询结果和设置的代理IP一致,则代理设置成功
|
||||
43
src/app/(home)/docs/browser-proxy/page.mdx
Normal file
43
src/app/(home)/docs/browser-proxy/page.mdx
Normal file
@@ -0,0 +1,43 @@
|
||||
# 浏览器代理设置教程(IE浏览器版)
|
||||
|
||||
## 概述
|
||||
本教程详细介绍如何在 **Internet Explorer(IE)浏览器** 中设置HTTP代理。按照以下步骤操作,您可以在几分钟内完成代理配置,实现网络访问地址的变更。
|
||||
|
||||
## 详细步骤
|
||||
|
||||
### 第一步:打开浏览器设置
|
||||
1. 启动 **Internet Explorer** 浏览器
|
||||
2. 点击右上角的 **齿轮图标**(工具菜单)
|
||||
3. 在下拉菜单中选择 **"Internet 选项"**
|
||||
|
||||
### 第二步:进入连接设置
|
||||
1. 在弹出的 "Internet 选项" 窗口中
|
||||
2. 切换到 **"连接"** 标签页
|
||||
3. 点击右下角的 **"局域网设置"** 按钮
|
||||
|
||||
### 第三步:配置代理服务器
|
||||
1. 在 "局域网(LAN)设置" 窗口中,找到 **代理服务器** 部分
|
||||
2. **勾选** "为 LAN 使用代理服务器"
|
||||
3. 填写代理信息:
|
||||
- **地址**:输入从代理服务商(如神龙HTTP)获取的IP地址
|
||||
- **端口**:输入对应的端口号
|
||||
4. (可选)如需设置高级选项:
|
||||
- 点击 **"高级"** 按钮
|
||||
- 可为不同协议(HTTP、HTTPS、FTP)单独设置代理
|
||||
- 可配置例外列表(不使用代理的地址)
|
||||
|
||||
### 第四步:保存并生效
|
||||
1. 点击 **"确定"** 保存局域网设置
|
||||
2. 再次点击 **"确定"** 关闭Internet选项窗口
|
||||
3. **刷新浏览器页面**(按F5或点击刷新按钮)
|
||||
4. 访问IP检测网站(如ip138.com)验证IP是否已更改
|
||||
|
||||
## 配置示例
|
||||
```yaml
|
||||
# 代理配置参数示例(根据实际服务商提供的信息填写)
|
||||
代理类型: HTTP
|
||||
服务器地址: 110.123.45.67 # 替换为实际IP
|
||||
端口号: 8080 # 替换为实际端口
|
||||
使用范围: 当前IE浏览器
|
||||
立即生效: 是
|
||||
```
|
||||
3
src/app/(home)/docs/faq-billing/page.mdx
Normal file
3
src/app/(home)/docs/faq-billing/page.mdx
Normal file
@@ -0,0 +1,3 @@
|
||||
# 计费与套餐问题
|
||||
|
||||
敬请期待~
|
||||
21
src/app/(home)/docs/faq-general/page.mdx
Normal file
21
src/app/(home)/docs/faq-general/page.mdx
Normal file
@@ -0,0 +1,21 @@
|
||||
# 常见问题(总览)
|
||||
|
||||
> 本文介绍如何在Firefox中配置静态和动态代理IP
|
||||
|
||||
## 静态代理配置
|
||||
|
||||
### 手动设置
|
||||
1. **打开设置**:`about:preferences#general`
|
||||
2. **网络设置** → **设置**
|
||||
3. 选择 **手动代理配置**
|
||||
|
||||
```json
|
||||
{
|
||||
"HTTP代理": "45.76.123.89",
|
||||
"端口": "8080",
|
||||
"SSL代理": "45.76.123.89",
|
||||
"端口": "8080",
|
||||
"SOCKS主机": "45.76.123.89",
|
||||
"端口": "1080"
|
||||
}
|
||||
```
|
||||
28
src/app/(home)/docs/firefox-proxy/page.mdx
Normal file
28
src/app/(home)/docs/firefox-proxy/page.mdx
Normal file
@@ -0,0 +1,28 @@
|
||||
# Firefox 设置 HTTP/Socks5 代理
|
||||
|
||||
Firefox 提供了多种代理设置方式,支持 HTTP/HTTPS 和 SOCKS5 协议。本教程将详细介绍各种配置方法。
|
||||
|
||||
## 配置方法概览
|
||||
|
||||
| 方法 | 适用场景 | 复杂度 | 持久性 |
|
||||
|------|----------|--------|--------|
|
||||
| 手动设置 | 单用户临时使用 | 低 | 重启浏览器失效 |
|
||||
| 自动代理(PAC) | 企业环境 | 中 | 永久 |
|
||||
| 扩展程序 | 灵活切换规则 | 高 | 永久 |
|
||||
| 系统级代理 | 全局代理 | 低 | 系统重启失效 |
|
||||
|
||||
## 手动代理设置
|
||||
|
||||
### 打开代理设置页面
|
||||
|
||||
1. **点击菜单按钮**(右上角三横线)
|
||||
2. 选择 **设置**(或直接访问 `about:preferences`)
|
||||
3. 滚动到页面底部
|
||||
4. 点击 **网络设置** → **设置**
|
||||
|
||||
```javascript
|
||||
// 快速访问代理设置的地址
|
||||
about:preferences#general
|
||||
// 或直接
|
||||
about:preferences
|
||||
```
|
||||
9
src/app/(home)/docs/fixed-package/page.mdx
Normal file
9
src/app/(home)/docs/fixed-package/page.mdx
Normal file
@@ -0,0 +1,9 @@
|
||||
# 长效固定套餐操作手册
|
||||
|
||||
一、打开官网产品订购页,选择固定IP套餐,平台支持按需选择全国城市/地区,套餐按照周/月/双月/季/年售卖;
|
||||
|
||||
二、套餐购买成功后,直接点击进入【个人中心】-【IP管理】-【固定IP】tab处,即可看到你所购买的套餐详情,您可以通过重置、查询、导出等操作具体查看;
|
||||
|
||||
三、打开电脑设置中的【代理服务器配置】,输入您的套餐中的IP地址&端口号并点击保存
|
||||
|
||||
四、打开游览器,输入账号&密码即可连接成功;查询本机IP地址,即可看到
|
||||
5
src/app/(home)/docs/http-notes/page.mdx
Normal file
5
src/app/(home)/docs/http-notes/page.mdx
Normal file
@@ -0,0 +1,5 @@
|
||||
# 使用 HTTP 代理注意事项
|
||||
|
||||
- 注意隐私与安全
|
||||
- 检查代理是否支持 HTTPS
|
||||
- 避免在不受信任网络输入敏感信息
|
||||
35
src/app/(home)/docs/ios-proxy/page.mdx
Normal file
35
src/app/(home)/docs/ios-proxy/page.mdx
Normal file
@@ -0,0 +1,35 @@
|
||||
# iOS 设置代理教程
|
||||
|
||||
本教程详细指导您在 iPhone 和 iPad 上配置代理服务器的完整步骤。
|
||||
|
||||
## 开始前的准备
|
||||
|
||||
在开始配置前,请确保您已获得以下信息:
|
||||
- **代理服务器地址**(如:proxy.example.com 或 192.168.1.100)
|
||||
- **端口号**(如:8080、8888)
|
||||
- 如需认证:**用户名和密码**
|
||||
- 企业网络可能需要的 **自动配置脚本 URL**
|
||||
|
||||
## 📱 Wi-Fi 网络代理设置(主要方式)
|
||||
|
||||
### 第一步:进入网络设置
|
||||
1. 打开 **"设置"** 应用
|
||||
2. 点击 **"无线局域网"**(Wi-Fi)
|
||||
3. 确保已连接到需要设置代理的 Wi-Fi 网络
|
||||
4. 点击当前 Wi-Fi 名称右侧的 **蓝色信息图标 (ⓘ)**
|
||||
|
||||
### 第二步:找到代理配置选项
|
||||
1. 在 Wi-Fi 详细信息页面中向下滑动
|
||||
2. 找到 **"配置代理"** 选项(通常在页面底部)
|
||||
3. 默认状态为 **"关闭"**
|
||||
|
||||
### 第三步:选择代理模式
|
||||
|
||||
点击"配置代理",您会看到三种选项:
|
||||
|
||||
```yaml
|
||||
# 模式选择说明
|
||||
关闭: 不使用代理
|
||||
自动: 使用自动配置脚本(.pac文件)
|
||||
手动: 手动输入代理服务器信息
|
||||
```
|
||||
37
src/app/(home)/docs/mac-proxy/page.mdx
Normal file
37
src/app/(home)/docs/mac-proxy/page.mdx
Normal file
@@ -0,0 +1,37 @@
|
||||
# macOS 设置代理教程
|
||||
|
||||
本教程详细指导您在 macOS 上配置代理服务器的完整步骤。
|
||||
|
||||
## 开始前的准备
|
||||
|
||||
在开始配置前,请确保您已获得以下信息:
|
||||
- **代理服务器地址**(如:proxy.example.com 或 192.168.1.100)
|
||||
- **端口号**(如:8080、8888)
|
||||
- 如需认证:**用户名和密码**
|
||||
- 企业网络可能需要的 **自动配置脚本 URL**
|
||||
|
||||
## 📱 Wi-Fi 网络代理设置(主要方式)
|
||||
|
||||
### 第一步:进入网络设置
|
||||
1. 打开 **"系统设置"** 应用
|
||||
2. 点击 **"网络"** 或 **"Wi-Fi"**
|
||||
3. 确保已连接到需要设置代理的 Wi-Fi 网络
|
||||
4. 点击 **"详情"** 或 **"高级"**
|
||||
|
||||
### 第二步:找到代理配置选项
|
||||
1. 在网络详细信息页面中找到 **"代理"** 选项
|
||||
2. 默认状态为 **"关闭"**
|
||||
|
||||
### 第三步:选择代理模式
|
||||
|
||||
点击"配置代理",您会看到几种选项:
|
||||
|
||||
```yaml
|
||||
# 模式选择说明
|
||||
关闭: 不使用代理
|
||||
自动代理发现: 自动发现代理
|
||||
自动代理配置: 使用自动配置脚本(.pac文件)
|
||||
网页代理(HTTP): 手动配置 HTTP 代理
|
||||
安全网页代理(HTTPS): 手动配置 HTTPS 代理
|
||||
SOCKS代理: 手动配置 SOCKS 代理
|
||||
```
|
||||
3
src/app/(home)/docs/news-announce/page.mdx
Normal file
3
src/app/(home)/docs/news-announce/page.mdx
Normal file
@@ -0,0 +1,3 @@
|
||||
# 公告
|
||||
|
||||
敬请期待~
|
||||
27
src/app/(home)/docs/news-latest/page.mdx
Normal file
27
src/app/(home)/docs/news-latest/page.mdx
Normal file
@@ -0,0 +1,27 @@
|
||||
# 了解代理服务器的工作原理
|
||||
|
||||
在网络通信中,代理服务器是一个重要的中间实体,充当了客户端和目标服务器之间的中转站。它既能够提供安全性和隐私保护,又能够改善网络性能和访问控制。那么,究竟代理服务器是如何工作的呢?接下来就让我们一起深入了解。
|
||||
|
||||
## 代理服务器的作用
|
||||
|
||||
1. **缓存和性能优化**
|
||||
|
||||
代理服务器可以缓存已经请求过的资源,例如网页、图片和视频等,这样当其他客户端再次请求同样的资源时,代理服务器可以直接返回缓存中的副本,从而减少了向目标服务器发起请求的次数,提高了整体的访问速度和响应效率。
|
||||
|
||||
2. **访问控制和过滤**
|
||||
|
||||
通过代理服务器,管理员可以限制特定用户或IP地址的访问权限。代理服务器可以设置访问规则,如阻止特定的URL、域名或协议,或者需要用户进行身份验证才能访问特定资源。这对于企业内部网络安全管理和家庭网络控制都非常有用。
|
||||
|
||||
3. **隐私保护和匿名访问**
|
||||
|
||||
代理服务器可以帮助用户隐藏真实的IP地址,提供匿名访问互联网的功能。在使用代理服务器时,用户的所有请求都会经过代理服务器转发,目标服务器无法直接获取到用户的真实身份信息,从而保护了用户的隐私。
|
||||
|
||||
## 配置代理服务器的方法
|
||||
|
||||
1. **客户端配置**
|
||||
|
||||
在大多数操作系统中,配置代理服务器的方法都相对简单。首先,打开网络设置选项,并找到代理服务器的设置项。根据你的需求,选择手动配置代理或者自动获取代理设置。如果你知道代理服务器的IP地址和端口号,将其填入相应的字段中即可。如果你需要身份验证或其他特殊设置,也可以在相应的位置进行配置。
|
||||
|
||||
2. **代理服务器配置**
|
||||
|
||||
代理服务器的配置则相对复杂一些,需要一定的网络知识和技术能力。首先,选择一款适合你需求的代理服务器软件,例如常用的Squid、Nginx等。然后,根据软件的文档和指南,按照要求进行安装和基本配置。在进行详细配置时,你可以根据实际需求进行设置,如缓存大小、访问规则、安全认证等。
|
||||
11
src/app/(home)/docs/official-tutorial/page.mdx
Normal file
11
src/app/(home)/docs/official-tutorial/page.mdx
Normal file
@@ -0,0 +1,11 @@
|
||||
# 浏览器设置代理教程
|
||||
|
||||
打开IE浏览器,选择"设置",点击"Internet选项",在弹出的"局域网LAN设置"中,代理服务器的复选框打上勾,并填写从神龙HTTP获取的ip地址及端口号,点击确定,刷新浏览器,浏览器的IP就改变了。
|
||||
|
||||
1、打开IE浏览器,选择"设置";
|
||||
|
||||
2、点击"Internet选项";
|
||||
|
||||
3、弹出"Internet选项"弹窗,选择连接—局域网设置;
|
||||
|
||||
4、在弹出的"局域网LAN设置"中,代理服务器的复选框打上勾,并填写从神龙HTTP代理获取的ip地址及端口。点击确定,即设置成功了。
|
||||
3
src/app/(home)/docs/online-ip-proxy/page.mdx
Normal file
3
src/app/(home)/docs/online-ip-proxy/page.mdx
Normal file
@@ -0,0 +1,3 @@
|
||||
# 在线 IP 代理地址
|
||||
|
||||
如何获取在线 IP 代理地址并在客户端或浏览器中配置和测试。
|
||||
29
src/app/(home)/docs/package-operations/page.mdx
Normal file
29
src/app/(home)/docs/package-operations/page.mdx
Normal file
@@ -0,0 +1,29 @@
|
||||
# 套餐续费、合并、修改时效、补量操作
|
||||
|
||||
一、套餐续费
|
||||
|
||||
1.登录个人中心-套餐管理页面,选择对应购买的套餐类型,点击续费按钮;
|
||||
|
||||
2.支付后,即可成功续费。专属定制套餐,按定制价格续费;官网购买的套餐,按官网最新的活动价格进行续费
|
||||
|
||||
二、合并套餐(仅针对IP时效、套餐类型、IP类型完全一样的包量套餐)
|
||||
|
||||
1.进入个人中心-套餐管理页面,选择对应购买的套餐类型,点击【合并套餐】;
|
||||
|
||||
2.输入被合并的套餐ID,点击确定。合并成功后,被合并的包量套餐IP总量增加,合并的包量套餐变更为"用完"。
|
||||
|
||||
三、修改时效
|
||||
|
||||
1.进入个人中心-套餐管理页面,选择对应购买的套餐类型,点击管理下拉,选中【修改时效】;
|
||||
|
||||
2.选择需要变更的IP时效,系统会自动换算出剩余IP总量。你也可以手动设置IP总量,多出的部分需要支付差价。
|
||||
|
||||
(续费、合并、增量、定制的套餐无法修改时效)
|
||||
|
||||
四、补量
|
||||
|
||||
1.进入个个人中心-套餐管理页面,选择对应购买的包时套餐类型,选中【补量】按钮;
|
||||
|
||||
2.每日补量数量可手动修改,支付成功后立即生效。
|
||||
|
||||
(定制套餐无法补量,需要联系您的专属销售进行操作)
|
||||
3
src/app/(home)/docs/product-cert/page.mdx
Normal file
3
src/app/(home)/docs/product-cert/page.mdx
Normal file
@@ -0,0 +1,3 @@
|
||||
# 实名认证与证书
|
||||
|
||||
关于实名认证、证书相关说明(占位)。
|
||||
3
src/app/(home)/docs/product-features/page.mdx
Normal file
3
src/app/(home)/docs/product-features/page.mdx
Normal file
@@ -0,0 +1,3 @@
|
||||
# 产品功能
|
||||
|
||||
产品功能列表与说明部分待完善,敬请期待。
|
||||
3
src/app/(home)/docs/product-overview/page.mdx
Normal file
3
src/app/(home)/docs/product-overview/page.mdx
Normal file
@@ -0,0 +1,3 @@
|
||||
# 产品概述
|
||||
|
||||
暂未产品概述,后期会补充内容,敬请期待。
|
||||
@@ -1,206 +1,158 @@
|
||||
'use client'
|
||||
import {useState, useMemo, useCallback} from 'react'
|
||||
import Link from 'next/link'
|
||||
import {useParams, usePathname} from 'next/navigation'
|
||||
import {usePathname} from 'next/navigation'
|
||||
import {ChevronRight} from 'lucide-react'
|
||||
|
||||
type Props = {
|
||||
collapsed?: boolean
|
||||
}
|
||||
|
||||
// 菜单结构
|
||||
const MENU_CONFIG = {
|
||||
tutorials: [
|
||||
{
|
||||
title: '官网教程',
|
||||
sectionKey: 'official-tutorial',
|
||||
items: [
|
||||
{key: 'browser-proxy', label: '浏览器设置代理教程'},
|
||||
{key: 'package-operations', label: '套餐续费、合并、修改时效、补重操作'},
|
||||
{key: 'fixed-package', label: '长效固定套餐操作手册'},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: '客户端教程',
|
||||
sectionKey: 'client-tutorial',
|
||||
items: [
|
||||
{key: 'ios-proxy', label: 'iOS设置代理教程'},
|
||||
{key: 'windows10-proxy', label: 'Windows10电脑设置代理教程'},
|
||||
{key: 'android-proxy', label: '安卓手机设置代理教程'},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: '操作指南',
|
||||
sectionKey: 'operation-guide',
|
||||
items: [
|
||||
{key: 'windows7-proxy', label: 'Windows7电脑设置代理教程'},
|
||||
{key: 'mac-proxy', label: 'MAC设置代理教程'},
|
||||
{key: 'firefox-proxy', label: '火狐浏览器设置代理'},
|
||||
{key: 'socks5-usage', label: 'Socks5代理使用教程'},
|
||||
],
|
||||
},
|
||||
],
|
||||
features: [
|
||||
{
|
||||
title: '产品介绍',
|
||||
sectionKey: 'product-intro',
|
||||
items: [
|
||||
{key: 'product-overview', label: '产品概述'},
|
||||
{key: 'product-features', label: '产品功能'},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: '常见问题',
|
||||
sectionKey: 'faq',
|
||||
items: [
|
||||
{key: 'faq-general', label: '常见问题总览'},
|
||||
{key: 'faq-billing', label: '计费与套餐问题'},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: '新闻资讯',
|
||||
sectionKey: 'news',
|
||||
items: [
|
||||
{key: 'news-latest', label: '了解代理服务器的工作原理'},
|
||||
{key: 'news-announce', label: '公告'},
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
// 简化的菜单配置 - 扁平结构,支持分组
|
||||
const MENU_ITEMS = [
|
||||
{
|
||||
group: '官网教程',
|
||||
items: [
|
||||
{key: 'browser-proxy', label: '浏览器设置代理教程'},
|
||||
{key: 'package-operations', label: '套餐续费、合并、修改时效、补重操作'},
|
||||
{key: 'fixed-package', label: '长效固定套餐操作手册'},
|
||||
],
|
||||
},
|
||||
{
|
||||
group: '客户端教程',
|
||||
items: [
|
||||
{key: 'ios-proxy', label: 'iOS设置代理教程'},
|
||||
{key: 'windows10-proxy', label: 'Windows10电脑设置代理教程'},
|
||||
{key: 'android-proxy', label: '安卓手机设置代理教程'},
|
||||
],
|
||||
},
|
||||
{
|
||||
group: '操作指南',
|
||||
items: [
|
||||
{key: 'windows7-proxy', label: 'Windows7电脑设置代理教程'},
|
||||
{key: 'mac-proxy', label: 'MAC设置代理教程'},
|
||||
{key: 'firefox-proxy', label: '火狐浏览器设置代理'},
|
||||
{key: 'socks5-usage', label: 'Socks5代理使用教程'},
|
||||
{key: 'http-notes', label: '使用 HTTP 代理注意事项'},
|
||||
{key: 'official-tutorial', label: '浏览器设置代理教程'},
|
||||
],
|
||||
},
|
||||
{
|
||||
group: '产品介绍',
|
||||
items: [
|
||||
{key: 'product-overview', label: '产品概述'},
|
||||
{key: 'product-features', label: '产品功能'},
|
||||
{key: 'product-cert', label: '实名认证与证书'},
|
||||
],
|
||||
},
|
||||
{
|
||||
group: '常见问题',
|
||||
items: [
|
||||
{key: 'faq-general', label: '常见问题总览'},
|
||||
{key: 'faq-billing', label: '计费与套餐问题'},
|
||||
],
|
||||
},
|
||||
{
|
||||
group: '新闻资讯',
|
||||
items: [
|
||||
{key: 'news-latest', label: '了解代理服务器的工作原理'},
|
||||
{key: 'news-announce', label: '公告'},
|
||||
],
|
||||
},
|
||||
{
|
||||
group: '其他',
|
||||
items: [
|
||||
{key: 'online-ip-proxy', label: '在线 IP 代理地址'},
|
||||
],
|
||||
},
|
||||
]
|
||||
|
||||
export default function Sidebar({collapsed = false}: Props) {
|
||||
const params = useParams()
|
||||
const pathname = usePathname()
|
||||
|
||||
// 判断当前所处的 help 子模块
|
||||
const getCategory = useCallback(() => {
|
||||
if (!pathname) return 'tutorials'
|
||||
if (pathname.includes('/help/features')) return 'features'
|
||||
if (pathname.includes('/help/tutorials')) return 'tutorials'
|
||||
return 'tutorials'
|
||||
// 获取当前文档 key (从 /help/{key} 路径中提取)
|
||||
const getCurrentKey = useCallback(() => {
|
||||
const parts = pathname?.split('/') || []
|
||||
return parts[2] || '' // /help/{key} -> key
|
||||
}, [pathname])
|
||||
|
||||
const category = getCategory()
|
||||
const MENU = category === 'features' ? MENU_CONFIG.features : MENU_CONFIG.tutorials
|
||||
const currentKey = getCurrentKey()
|
||||
|
||||
// 获取当前 sectionKey 和 itemKey
|
||||
const getCurrentKeys = useCallback(() => {
|
||||
const pathParts = pathname?.split('/') || []
|
||||
let sectionKey = ''
|
||||
let itemKey = ''
|
||||
// 展开/收起状态
|
||||
const [expandedGroups, setExpandedGroups] = useState<Record<string, boolean>>({})
|
||||
|
||||
if (pathParts.length >= 4) {
|
||||
sectionKey = pathParts[3]
|
||||
}
|
||||
if (pathParts.length >= 5) {
|
||||
itemKey = pathParts[4]
|
||||
}
|
||||
|
||||
// 如果从 params 获取
|
||||
if (!sectionKey && params?.section) {
|
||||
sectionKey = String(params.section)
|
||||
}
|
||||
if (!itemKey && params?.key) {
|
||||
itemKey = String(params.key)
|
||||
}
|
||||
|
||||
return {sectionKey, itemKey}
|
||||
}, [pathname, params])
|
||||
|
||||
const {sectionKey: currentSectionKey, itemKey: currentItemKey} = getCurrentKeys()
|
||||
|
||||
const expandedSections = useMemo(() => {
|
||||
const newExpanded: Record<string, boolean> = {}
|
||||
const hasActiveSection = MENU.some(s => s.sectionKey === currentSectionKey)
|
||||
|
||||
MENU.forEach((section, index) => {
|
||||
if (section.sectionKey === currentSectionKey) {
|
||||
newExpanded[section.title] = true
|
||||
}
|
||||
else if (!hasActiveSection && index === 0) {
|
||||
newExpanded[section.title] = true
|
||||
}
|
||||
else {
|
||||
newExpanded[section.title] = false
|
||||
// 初始化:自动展开包含当前活跃项的分组
|
||||
const initialExpandedGroups = useMemo(() => {
|
||||
const result: Record<string, boolean> = {}
|
||||
MENU_ITEMS.forEach((section, index) => {
|
||||
const hasActive = section.items.some(item => item.key === currentKey)
|
||||
if (hasActive || index === 0) {
|
||||
result[section.group] = true
|
||||
}
|
||||
})
|
||||
|
||||
return newExpanded
|
||||
}, [MENU, currentSectionKey])
|
||||
|
||||
// 使用 state 来跟踪用户的手动切换
|
||||
const [userToggles, setUserToggles] = useState<Record<string, boolean>>({})
|
||||
|
||||
// 合并自动展开和用户手动切换的状态
|
||||
const finalExpandedSections = useMemo(() => {
|
||||
const result = {...expandedSections}
|
||||
|
||||
Object.keys(userToggles).forEach((title) => {
|
||||
const section = MENU.find(s => s.title === title)
|
||||
if (section && section.sectionKey !== currentSectionKey) {
|
||||
result[title] = userToggles[title]
|
||||
}
|
||||
})
|
||||
|
||||
return result
|
||||
}, [expandedSections, userToggles, MENU, currentSectionKey])
|
||||
}, [currentKey])
|
||||
|
||||
const toggleSection = (title: string) => {
|
||||
const section = MENU.find(s => s.title === title)
|
||||
if (!section) return
|
||||
if (section.sectionKey === currentSectionKey) {
|
||||
setUserToggles(prev => ({
|
||||
...prev,
|
||||
[title]: !finalExpandedSections[title],
|
||||
}))
|
||||
}
|
||||
else {
|
||||
setUserToggles(prev => ({
|
||||
...prev,
|
||||
[title]: !prev[title],
|
||||
}))
|
||||
}
|
||||
// 合并自动展开和用户手动切换
|
||||
const finalExpandedGroups = useMemo(() => {
|
||||
return {...initialExpandedGroups, ...expandedGroups}
|
||||
}, [initialExpandedGroups, expandedGroups])
|
||||
|
||||
const toggleGroup = (group: string) => {
|
||||
setExpandedGroups(prev => ({
|
||||
...prev,
|
||||
[group]: !finalExpandedGroups[group],
|
||||
}))
|
||||
}
|
||||
|
||||
// 构建链接地址
|
||||
const getItemHref = useCallback((sectionKey: string, itemKey: string) => {
|
||||
return category === 'features'
|
||||
? `/help/features/${sectionKey}/${itemKey}`
|
||||
: `/help/tutorials/${sectionKey}/${itemKey}`
|
||||
}, [category])
|
||||
const getItemHref = (key: string) => `/help/${key}`
|
||||
|
||||
return (
|
||||
<aside className={`bg-white rounded-lg p-3 transition-all duration-200 shrink-0 ${collapsed ? 'w-20' : 'w-72'}`}>
|
||||
<aside
|
||||
className={`bg-white rounded-lg p-3 transition-all duration-200 shrink-0 ${
|
||||
collapsed ? 'w-20' : 'w-72'
|
||||
}`}
|
||||
>
|
||||
<nav className="space-y-2">
|
||||
{MENU.map(section => (
|
||||
<div key={section.title}>
|
||||
{MENU_ITEMS.map(section => (
|
||||
<div key={section.group}>
|
||||
<div
|
||||
onClick={() => toggleSection(section.title)}
|
||||
className={`flex items-center gap-2 cursor-pointer px-3 py-2 rounded-sm transition-colors ${finalExpandedSections[section.title] && !collapsed ? 'bg-blue-50' : 'hover:bg-slate-50'}`}
|
||||
onClick={() => toggleGroup(section.group)}
|
||||
className={`flex items-center gap-2 cursor-pointer px-3 py-2 rounded-sm transition-colors ${
|
||||
finalExpandedGroups[section.group] && !collapsed
|
||||
? 'bg-blue-50'
|
||||
: 'hover:bg-slate-50'
|
||||
}`}
|
||||
>
|
||||
<div className={`w-4 flex items-center justify-center text-sm text-slate-400 transform transition-transform ${finalExpandedSections[section.title] ? 'rotate-90' : ''}`}>
|
||||
<ChevronRight size={16}/>
|
||||
<div
|
||||
className={`w-4 flex items-center justify-center text-sm text-slate-400 transform transition-transform ${
|
||||
finalExpandedGroups[section.group] ? 'rotate-90' : ''
|
||||
}`}
|
||||
>
|
||||
<ChevronRight size={16} />
|
||||
</div>
|
||||
|
||||
{!collapsed && (
|
||||
<div className="text-lg font-semibold text-slate-900">
|
||||
{section.title}
|
||||
{section.group}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{finalExpandedSections[section.title] && (
|
||||
{finalExpandedGroups[section.group] && (
|
||||
<ul className={`mt-1 text-base ${collapsed ? 'hidden' : 'block'}`}>
|
||||
{section.items.map((item) => {
|
||||
const isActive = currentItemKey === item.key
|
||||
const href = getItemHref(section.sectionKey, item.key)
|
||||
{section.items.map(item => {
|
||||
const isActive = currentKey === item.key
|
||||
const href = getItemHref(item.key)
|
||||
|
||||
return (
|
||||
<li key={item.key}>
|
||||
<Link
|
||||
href={href}
|
||||
className={`block pl-8 py-2 text-base cursor-pointer transition-colors ${
|
||||
isActive ? 'bg-blue-50 font-semibold' : 'text-slate-700 hover:text-slate-900 hover:bg-slate-50'
|
||||
isActive
|
||||
? 'bg-blue-50 font-semibold'
|
||||
: 'text-slate-700 hover:text-slate-900 hover:bg-slate-50'
|
||||
}`}
|
||||
>
|
||||
{item.label}
|
||||
|
||||
29
src/app/(home)/docs/socks5-usage/page.mdx
Normal file
29
src/app/(home)/docs/socks5-usage/page.mdx
Normal file
@@ -0,0 +1,29 @@
|
||||
# 使用 Socks5 代理上网
|
||||
|
||||
Socks5 是一种网络代理协议,用于在计算机之间传递数据,同时提供匿名性和安全性。
|
||||
|
||||
## Socks5 代理的优点
|
||||
|
||||
1. **更高的安全性**:Socks5 协议支持加密传输,可以确保数据在传输过程中的安全性。
|
||||
2. **更高的匿名性**:Socks5 协议支持 UDP 和 TCP 流量代理,并且支持不同的身份验证方式,可以帮助用户隐藏真实 IP 地址,保护隐私。
|
||||
3. **更高的灵活性**:Socks5 代理可以让应用程序无需修改代码即可使用代理 IP,同时支持多种身份验证方式和传输协议,提高了灵活性和可用性。
|
||||
|
||||
## Socks5 代理工作流程
|
||||
|
||||
1. 用户向代理服务器发送连接请求。
|
||||
2. 代理服务器收到连接请求后,根据用户请求的目标地址和端口,向目标服务器发起连接请求。
|
||||
3. 目标服务器收到代理服务器的连接请求后,回复确认连接。
|
||||
4. 代理服务器收到目标服务器的确认连接后,将数据转发给目标服务器。
|
||||
5. 目标服务器接收到数据后,将数据返回给代理服务器。
|
||||
6. 代理服务器收到数据后,将数据转发给用户。
|
||||
|
||||
在这个过程中,Socks5 代理服务器起到了中间传输的作用,将用户的请求转发给目标服务器,并将目标服务器的响应返回给用户。由于传输过程中使用的是代理服务器的 IP 地址和端口号,所以用户的真实 IP 地址和端口号得到了隐藏。
|
||||
|
||||
## 配置方法概览
|
||||
|
||||
| 方法 | 适用场景 | 复杂度 | 持久性 |
|
||||
|------|----------|--------|--------|
|
||||
| 手动设置 | 单用户临时使用 | 低 | 重启浏览器失效 |
|
||||
| 自动代理(PAC) | 企业环境 | 中 | 永久 |
|
||||
| 扩展程序 | 灵活切换规则 | 高 | 永久 |
|
||||
| 系统级代理 | 全局代理 | 低 | 系统重启失效 |
|
||||
7
src/app/(home)/docs/windows10-proxy/page.mdx
Normal file
7
src/app/(home)/docs/windows10-proxy/page.mdx
Normal file
@@ -0,0 +1,7 @@
|
||||
# Windows10 电脑设置代理教程
|
||||
|
||||
1、点击桌面右下角网络连接图标,选择"网络和Internet设置"选项
|
||||
|
||||
2、点击"代理",将"使用代理服务器"设置为开,输入地址和端口后保存
|
||||
|
||||
3、浏览器打开百度,输入IP地址查询,若查询结果和设置的代理IP一致,则代理设置成功
|
||||
Reference in New Issue
Block a user