fix: 修复 WebRTC 控制稳定性与输入事件重复问题

- 修复安卓端 401 拦截器线程问题,确保 Toast 在主线程执行
- 修复 Web 端按键/触摸重复触发:增加按下状态跟踪,防止悬停触发动作和长按重复
- 修复 Web 端指针取消时未释放触摸状态导致被控端卡死
- 修复 TURN 未启用时返回 401 导致客户端异常登出,改为返回 enabled=false
- 修复后台管理端 401 后路由守卫跳转失败
- 增加控制指令调试日志用于排查问题
This commit is contained in:
TongTongStudio
2026-08-04 02:40:23 +08:00
parent 1bd0318d35
commit 9b0e105647
7 changed files with 86 additions and 13 deletions

View File

@@ -391,10 +391,11 @@ curl -X POST https://www.ttstd.com/api/client/pairing/redeem \
| 方法 | 路径 | 令牌 | 说明 |
| --- | --- | --- | --- |
| GET | `/api/client/turn-credentials` | 用户/设备 | 返回 `iceServers`(含 urls/username/credential`expiresAt``ttlSeconds` |
| GET | `/api/client/turn-credentials` | 用户/设备 | 返回 `enabled``iceServers`(含 urls/username/credential`expiresAt``ttlSeconds` |
```json
{
"enabled": true,
"iceServers": [
{ "urls": "turn:turn.ttstd.com:3478?transport=udp",
"username": "1730000000:ab12cd34ef56",
@@ -406,6 +407,7 @@ curl -X POST https://www.ttstd.com/api/client/pairing/redeem \
```
> 客户端应将 `iceServers` 直接传入 `RTCPeerConnection` 配置;凭证过期后重新 GET 本接口刷新。
> 服务端未启用 TURN 时返回 200 + `{"enabled": false, "iceServers": []}`(不会返回 401客户端据此降级为仅 STUN。
#### 骚扰举报P2 风控)
被控端遭遇骚扰时可举报某主控端账号,管理员在 `/api/admin/abuse-reports` 查看并处理。