Files
file-transfer-go/chuan-next/URL_ROUTING.md
2025-08-01 17:15:55 +08:00

55 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# URL 路由参数说明
现在您可以通过URL参数直接导航到特定的功能和模式。
## URL 参数格式
```
http://localhost:3000/?type={功能类型}&mode={操作模式}
```
## 支持的参数
### type功能类型
- `file` - 文件传输
- `text` - 文字传输
- `desktop` - 桌面共享
### mode操作模式
- `send` - 发送/共享模式
- `receive` - 接收/观看模式
## 使用示例
### 文件传输
- 发送文件:`/?type=file&mode=send`
- 接收文件:`/?type=file&mode=receive`
### 文字传输
- 发送文字:`/?type=text&mode=send`
- 接收文字:`/?type=text&mode=receive`
### 桌面共享
- 共享桌面:`/?type=desktop&mode=send`
- 观看桌面:`/?type=desktop&mode=receive`
## 功能特性
1. **自动切换**访问带参数的URL会自动切换到对应的功能和模式
2. **URL同步**用户手动切换功能和模式时URL会自动更新
3. **无页面刷新**:所有切换都通过客户端路由实现,无需刷新页面
4. **向后兼容**:不带参数访问时,默认显示文件传输-发送模式
## 实际应用场景
1. **分享链接**:可以直接分享特定功能的链接给其他用户
2. **书签管理**:用户可以为常用功能创建书签
3. **快速访问**:通过预设链接快速跳转到特定功能
4. **集成其他系统**便于其他系统通过URL直接跳转到特定功能
## 注意事项
- 桌面共享功能中,`send`模式对应"共享桌面"`receive`模式对应"观看桌面"
- 如果提供了无效的参数值,系统会回退到默认设置
- URL参数不区分大小写