chore: 统一开发服务器端口为 13098

- 更新 .env.example、env.ts、vite.config.ts 默认端口
- 同步更新 sidecar.rs Rust 端口常量
- 更新 README、AGENTS.md 等文档中的端口引用
This commit is contained in:
2026-01-27 11:10:21 +08:00
parent d22a0f8d69
commit f2db4bff9d
7 changed files with 24 additions and 23 deletions

View File

@@ -69,7 +69,7 @@ cd openbridge-token-usage-viewer
bun install
# 3. 启动开发服务器
bun run dev:vite # 仅 Web (http://localhost:3000)
bun run dev:vite # 仅 Web (http://localhost:13098)
bun run dev # Tauri 桌面应用 + Web
```
@@ -126,7 +126,7 @@ TOKEN_USAGE_URL=http://your-server:8318/usage
| 命令 | 说明 |
|------|------|
| `bun dev` | 启动 Tauri + Vite 开发服务器 (并行) |
| `bun dev:vite` | 仅启动 Vite 开发服务器 (http://localhost:3000) |
| `bun dev:vite` | 仅启动 Vite 开发服务器 (http://localhost:13098) |
| `bun dev:tauri` | 仅启动 Tauri (需先启动 Vite) |
| `bun db:studio` | 打开 Drizzle Studio 数据库管理界面 |
@@ -229,7 +229,7 @@ const { data } = useSuspenseQuery(orpc.usage.getUsage.queryOptions())
1. **Tauri 壳**: 提供原生窗口和系统集成
2. **Bun 服务端**: 编译为独立可执行文件,处理 SSR 和 API 请求
3. **通信**: Tauri WebView 通过 localhost:3000 与 Sidecar 通信
3. **通信**: Tauri WebView 通过 localhost:13098 与 Sidecar 通信
### 数据流
@@ -295,10 +295,10 @@ rm -rf src-tauri/target
```bash
# Windows
netstat -ano | findstr :3000
netstat -ano | findstr :13098
# Linux/macOS
lsof -i :3000
lsof -i :13098
```
#### 5. 重新构建
@@ -311,7 +311,7 @@ bun run build
#### "An unhandled error happened!" 错误
1. 确保没有其他进程占用端口 3000
1. 确保没有其他进程占用端口 13098
2. 尝试完全清理缓存后重新构建
3. 检查 `.env` 文件中的 `TOKEN_USAGE_URL` 配置是否正确
@@ -319,7 +319,7 @@ bun run build
```powershell
# 查找占用端口的进程
netstat -ano | findstr :3000
netstat -ano | findstr :13098
# 结束进程 (替换 PID 为实际进程 ID)
taskkill /F /PID <PID>