feat:修改websocket跳转效果
This commit is contained in:
@@ -18,8 +18,25 @@ export class WebSocketTestController {
|
||||
|
||||
@Get()
|
||||
@ApiOperation({
|
||||
summary: 'WebSocket 测试页面',
|
||||
description: '提供一个简单的WebSocket测试界面,可以直接在浏览器中测试连接和消息发送'
|
||||
summary: '🔌 WebSocket 测试页面 - 一键测试工具',
|
||||
description: `
|
||||
**🚀 功能强大的WebSocket测试工具**
|
||||
|
||||
提供完整的WebSocket测试功能:
|
||||
- ✅ 自动获取JWT Token
|
||||
- ✅ 一键建立WebSocket连接
|
||||
- ✅ 用户认证和登录
|
||||
- ✅ 聊天消息发送测试
|
||||
- ✅ 位置更新测试
|
||||
- ✅ 实时消息日志
|
||||
|
||||
**使用方法**:
|
||||
1. 点击下方"Execute"按钮
|
||||
2. 在响应中会返回完整的测试页面HTML
|
||||
3. 或直接访问: /websocket-test
|
||||
|
||||
**推荐**:直接在新标签页中打开 [/websocket-test](/websocket-test)
|
||||
`
|
||||
})
|
||||
@ApiResponse({
|
||||
status: 200,
|
||||
@@ -165,8 +182,10 @@ export class WebSocketTestController {
|
||||
<p><strong>4. 发送消息:</strong> 认证成功后可以发送聊天消息和位置更新</p>
|
||||
<p><strong>WebSocket地址:</strong> <code>wss://whaletownend.xinghangee.icu/game</code></p>
|
||||
|
||||
<div style="margin-top: 15px;">
|
||||
<a href="/api-docs" target="_blank" style="margin-right: 15px; color: #1976d2; text-decoration: none;">📚 返回 API 文档</a>
|
||||
<div style="margin-top: 15px; padding: 10px; background-color: #e3f2fd; border-radius: 4px;">
|
||||
<strong>🔗 相关链接:</strong>
|
||||
<a href="/api-docs" target="_blank" style="margin-right: 15px; color: #1976d2; text-decoration: none; font-weight: bold;">📚 返回 API 文档</a>
|
||||
<a href="/websocket/docs" target="_blank" style="margin-right: 15px; color: #1976d2; text-decoration: none;">📖 WebSocket API 文档</a>
|
||||
<a href="/websocket-api/connection-info" target="_blank" style="color: #1976d2; text-decoration: none;">🔧 连接配置信息</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
13
src/main.ts
13
src/main.ts
@@ -75,6 +75,19 @@ async function bootstrap() {
|
||||
.setDescription(`
|
||||
像素游戏服务器API文档 - 包含用户认证、聊天系统、Zulip集成等功能
|
||||
|
||||
## 🚀 快速测试工具
|
||||
|
||||
### 🔌 WebSocket 测试页面
|
||||
**[点击这里打开 WebSocket 测试工具 →](/websocket-test)**
|
||||
|
||||
一键测试WebSocket连接、用户认证、消息发送等功能,无需额外工具!
|
||||
|
||||
### 📚 其他测试工具
|
||||
- **[WebSocket API 文档](/websocket/docs)** - 详细的消息格式和示例
|
||||
- **[WebSocket 连接信息](/chat/websocket/info)** - 连接配置和参数
|
||||
|
||||
---
|
||||
|
||||
## 主要功能模块
|
||||
|
||||
### 🔐 用户认证 (auth)
|
||||
|
||||
Reference in New Issue
Block a user