/// 监听地址。默认 0.0.0.0(局域网可发现可直连);
diff --git a/desktop/Services/Agent/ServiceInstaller.cs b/desktop/Services/Agent/ServiceInstaller.cs
index 0196a25..9dff85a 100644
--- a/desktop/Services/Agent/ServiceInstaller.cs
+++ b/desktop/Services/Agent/ServiceInstaller.cs
@@ -2,6 +2,7 @@ using System;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
+using System.Linq;
using System.Runtime.InteropServices;
using System.Text.Json;
using System.Threading;
@@ -359,6 +360,13 @@ public static class ServiceInstaller
return new HelperResult { Ok = true, Message = "后台服务已卸载" };
}
+ /// 旧版本用 17xxx 端口时的防火墙规则名(升级时清掉,别继续占着别人项目的端口)
+ private static readonly string[] LegacyFirewallRuleNames =
+ {
+ "YuncangTrace Edge (TCP 17311)",
+ "YuncangTrace Edge (UDP 17310)",
+ };
+
///
/// 放行局域网发现端口(TCP 取流健康端点 + UDP 询问应答)。
///
@@ -370,8 +378,14 @@ public static class ServiceInstaller
///
private static void EnsureFirewallRules()
{
- AddFirewallRule("YuncangTrace Edge (TCP 17311)", "TCP", "17311");
- AddFirewallRule("YuncangTrace Edge (UDP 17310)", "UDP", "17310");
+ AddFirewallRule("YuncangTrace Edge (TCP 16101)", "TCP", "16101");
+ AddFirewallRule("YuncangTrace Edge (UDP 16100)", "UDP", "16100");
+
+ // 老版本(17xxx)装过的规则名带端口号,升级后不会自动消失,这里顺手清掉
+ foreach (var name in LegacyFirewallRuleNames)
+ {
+ RunTool("netsh.exe", "advfirewall", "firewall", "delete", "rule", $"name={name}");
+ }
}
private static void AddFirewallRule(string name, string protocol, string port)
@@ -393,7 +407,8 @@ public static class ServiceInstaller
private static void RemoveFirewallRules()
{
- foreach (var name in new[] { "YuncangTrace Edge (TCP 17311)", "YuncangTrace Edge (UDP 17310)" })
+ foreach (var name in new[] { "YuncangTrace Edge (TCP 16101)", "YuncangTrace Edge (UDP 16100)" }
+ .Concat(LegacyFirewallRuleNames))
{
RunTool("netsh.exe", "advfirewall", "firewall", "delete", "rule", $"name={name}");
}
diff --git a/desktop/Services/Hik/HikPreviewService.cs b/desktop/Services/Hik/HikPreviewService.cs
index c3ee9c3..a008a1b 100644
--- a/desktop/Services/Hik/HikPreviewService.cs
+++ b/desktop/Services/Hik/HikPreviewService.cs
@@ -6,7 +6,7 @@ using System.Threading;
namespace YuncangTrace.LocalService.Services.Hik;
///
-/// 预览会话管理(实时预览唯一入口,由 WS 17301 驱动)。
+/// 预览会话管理(实时预览唯一入口,由 WS 16001 驱动)。
///
/// 为什么要有「会话」这层:
/// - 网页预览时凭据只发一次(走 WS 的 start_preview),之后每帧按 sid 区分,
diff --git a/desktop/Services/LocalHttpServer.cs b/desktop/Services/LocalHttpServer.cs
index 04aeb76..6f1efa2 100644
--- a/desktop/Services/LocalHttpServer.cs
+++ b/desktop/Services/LocalHttpServer.cs
@@ -26,13 +26,13 @@ namespace YuncangTrace.LocalService.Services;
///
public sealed class LocalHttpServer : IDisposable
{
- /// 监听端口(前端/插件里写死的 17300;可用 YUNCANG_LOCAL_PORT 临时覆盖,便于自测)
+ /// 监听端口(前端/插件里写死的 16000;可用 YUNCANG_LOCAL_PORT 临时覆盖,便于自测)
public static int Port { get; } = ResolvePort();
private static int ResolvePort()
{
var raw = Environment.GetEnvironmentVariable("YUNCANG_LOCAL_PORT");
- return int.TryParse(raw, out var port) && port is > 0 and < 65536 ? port : 17300;
+ return int.TryParse(raw, out var port) && port is > 0 and < 65536 ? port : 16000;
}
private readonly LoopbackHttpServer _listener;
@@ -140,7 +140,7 @@ public sealed class LocalHttpServer : IDisposable
return;
}
- // ⚠️ 海康相关(拉通道 / 实时预览 / 云台 / 满帧率窗口)已全部迁到 WS 17301(LocalWsServer),这里不再提供。
+ // ⚠️ 海康相关(拉通道 / 实时预览 / 云台 / 满帧率窗口)已全部迁到 WS 16001(LocalWsServer),这里不再提供。
// 按运单下载录像:POST /api/playback/download { code }
// 网页查件页(/local?code=)用 —— 任何装了本机软件的电脑都能下,存到本机设置的目录
@@ -152,12 +152,12 @@ public sealed class LocalHttpServer : IDisposable
if (!request.Method.Equals("GET", StringComparison.OrdinalIgnoreCase))
{
- // 只剩 GET 接口了;旧的 POST /api/hik/* 会走到这里(预览/云台/拉通道已迁到 WS 17301)
+ // 只剩 GET 接口了;旧的 POST /api/hik/* 会走到这里(预览/云台/拉通道已迁到 WS 16001)
await WriteJsonAsync(response, 404, new
{
ok = false,
state = "not-found",
- message = "接口不存在(拉通道 / 预览 / 云台已迁到 WebSocket 17301)",
+ message = "接口不存在(拉通道 / 预览 / 云台已迁到 WebSocket 16001)",
}).ConfigureAwait(false);
return;
}
@@ -238,13 +238,13 @@ public sealed class LocalHttpServer : IDisposable
云仓视频溯源软件(本机服务)
- 服务运行中,只监听本机(127.0.0.1:17300)。
+ 服务运行中,只监听本机(127.0.0.1:16000)。
/api/query/{运单号} 查询(同时返回服务/登录状态;没登录回 401)
POST /api/activate-login 把登录窗叫到前台
POST /api/playback/download 按运单下载录像
- 拉通道 / 实时预览 / 云台 / 满帧率窗口走 WebSocket:ws://127.0.0.1:17301
+ 拉通道 / 实时预览 / 云台 / 满帧率窗口走 WebSocket:ws://127.0.0.1:16001
""";
await WriteHtmlAsync(response, 200, html).ConfigureAwait(false);
return;
diff --git a/desktop/Services/LocalWsServer.cs b/desktop/Services/LocalWsServer.cs
index 5228df6..354f260 100644
--- a/desktop/Services/LocalWsServer.cs
+++ b/desktop/Services/LocalWsServer.cs
@@ -13,7 +13,7 @@ using YuncangTrace.LocalService.Services.Hik;
namespace YuncangTrace.LocalService.Services;
///
-/// 本机 WebSocket 服务(只监听 127.0.0.1,默认端口 17301)
+/// 本机 WebSocket 服务(只监听 127.0.0.1,默认端口 16001)
///
/// 给网页的实时预览 / 云台 / 拉通道用:以前走 HTTP(先 POST 建会话、再用 <img> 拉 MJPEG),
/// 跨域/代理/多标签场景下都要多一次请求,而且浏览器对 MJPEG 的复用不总是如意;WS 下一条连接可以:
@@ -40,7 +40,7 @@ public sealed class LocalWsServer : IDisposable
private static int ResolvePort()
{
var raw = Environment.GetEnvironmentVariable("YUNCANG_LOCAL_WS_PORT");
- return int.TryParse(raw, out var port) && port is > 0 and < 65536 ? port : 17301;
+ return int.TryParse(raw, out var port) && port is > 0 and < 65536 ? port : 16001;
}
/// RFC 6455 规定的握手固定串
@@ -121,7 +121,7 @@ public sealed class LocalWsServer : IDisposable
private async Task HandleContextAsync(LocalHttpRequest request, LocalHttpResponse response)
{
- // 非 WS 请求:给网页/排障一个轻量探活(浏览器直接打开 ws://127.0.0.1:17301/ 就看这个)
+ // 非 WS 请求:给网页/排障一个轻量探活(浏览器直接打开 ws://127.0.0.1:16001/ 就看这个)
if (!request.IsWebSocketRequest)
{
await WriteProbeAsync(response).ConfigureAwait(false);
diff --git a/desktop/Services/SingleInstance.cs b/desktop/Services/SingleInstance.cs
index c2255aa..25063e3 100644
--- a/desktop/Services/SingleInstance.cs
+++ b/desktop/Services/SingleInstance.cs
@@ -11,7 +11,7 @@ namespace YuncangTrace.LocalService.Services;
/// 单实例 + 参数转发(命名管道)
///
/// 场景:窗口已经开着,用户又点了一次 WMS 页面上的「查看打包视频」→ 系统按协议再启动一次本程序。
-/// 这时第二个实例**不应该**去抢 17300 端口,而是把 `yuncang://open?code=xxx` 通过管道送给第一个实例,
+/// 这时第二个实例**不应该**去抢 16000 端口,而是把 `yuncang://open?code=xxx` 通过管道送给第一个实例,
/// 由它把窗口激活并查询那个运单号。
///
public sealed class SingleInstance : IDisposable
diff --git a/desktop/YuncangTrace.LocalService.csproj b/desktop/YuncangTrace.LocalService.csproj
index bf49e48..95517c2 100644
--- a/desktop/YuncangTrace.LocalService.csproj
+++ b/desktop/YuncangTrace.LocalService.csproj
@@ -42,7 +42,7 @@
http://127.0.0.1:7300
https://packs.example.com
- 1.0.161
+ 1.0.162
云仓视频溯源软件
云仓
云仓视频溯源软件(本机服务)
diff --git a/desktop/installer/test-update.ps1 b/desktop/installer/test-update.ps1
index 52643e2..1fa1bd9 100644
--- a/desktop/installer/test-update.ps1
+++ b/desktop/installer/test-update.ps1
@@ -12,7 +12,7 @@
3. 关掉正在运行的软件(含单文件自解压出来的真实进程);
4. 启动**旧版本**,并设置 YUNCANG_AUTO_UPDATE=1(更新窗口出现后自动开始下载);
5. 轮询安装目录的 ProductVersion,直到变成目标版本(或超时);
- 6. 检查本机服务 17300 是否有响应、进程是否已恢复。
+ 6. 检查本机服务 16000 是否有响应、进程是否已恢复。
.PARAMETER TimeoutSeconds
等更新完成的最长时间,默认 180 秒。
@@ -112,16 +112,16 @@ $probeDeadline = (Get-Date).AddSeconds(60)
$localCode = $null
$processes = @()
while ((Get-Date) -lt $probeDeadline) {
- $localCode = & curl.exe -s -o NUL -w "%{http_code}" --max-time 3 "http://127.0.0.1:17300/api/query/"
+ $localCode = & curl.exe -s -o NUL -w "%{http_code}" --max-time 3 "http://127.0.0.1:16000/api/query/"
$processes = @(Get-CimInstance Win32_Process | Where-Object { $_.Name -like '*Yuncang*' })
if ($processes.Count -gt 0 -and $localCode -and $localCode -ne '000') { break }
Start-Sleep -Seconds 3
}
if ($localCode -and $localCode -ne '000') {
- Write-Host "✔ 本机服务 17300 有响应(HTTP $localCode)" -ForegroundColor Green
+ Write-Host "✔ 本机服务 16000 有响应(HTTP $localCode)" -ForegroundColor Green
} else {
- Write-Host "✘ 本机服务 17300 无响应" -ForegroundColor Red
+ Write-Host "✘ 本机服务 16000 无响应" -ForegroundColor Red
}
if ($processes.Count -gt 0) {
diff --git a/extension/README.md b/extension/README.md
index 0923376..8570946 100644
--- a/extension/README.md
+++ b/extension/README.md
@@ -265,11 +265,11 @@ npx --yes http-server extension/test -p 7310 # → http://127.0.0.1:7310/wms
| `storage` | 存下发下来的配置(优先 `storage.sync`,超 8KB 自动退到 `storage.local`) |
| `alarms` | 每 5 分钟定时拉配置(MV3 的 service worker 会被回收,不能用 `setInterval`) |
| `host_permissions: https://pack.wms.gztbyc.com/*` | 拉 `GET /api/web/extension/config` |
-| `host_permissions: http(s)://localhost:17300/*` | 探测本机软件是否在跑(协议唤起兜底) |
+| `host_permissions: http(s)://localhost:16000/*` | 探测本机软件是否在跑(协议唤起兜底) |
| content script `matches: http(s)://*/*` | 需要注入任意第三方系统,无法预先枚举域名 |
- 不请求 `tabs` / `scripting` / `cookies`,**不读页面 cookie**;唯一的出站请求就是上面那个配置接口
- (以及本机 17300 的探测)。点击只是把算好的 URL 交给 `chrome.tabs.create` / `chrome.windows.create`。
+ (以及本机 16000 的探测)。点击只是把算好的 URL 交给 `chrome.tabs.create` / `chrome.windows.create`。
- 注入走隔离世界(ISOLATED),不注入页面上下文,不受宿主页 CSP 影响。
- 想收窄范围:改 `manifest.json` 里 `content_scripts[0].matches` 为具体域名(如 `https://wms.wms.gztbyc.com/*`),
重新加载扩展即可;规则层面的范围由「生效站点」控制。
diff --git a/extension/STORE-SUBMISSION.md b/extension/STORE-SUBMISSION.md
index ce4cab5..4f1692c 100644
--- a/extension/STORE-SUBMISSION.md
+++ b/extension/STORE-SUBMISSION.md
@@ -117,7 +117,7 @@ Policy: https://pack.wms.gztbyc.com/extension-privacy.html
| `alarms` | 每 5 分钟拉取一次配置,保证管理员改完尽快生效。 | Periodic (5 min) refresh of the read-only configuration. |
| `content_scripts` 全站(`http://*/*`, `https://*/*`) | 客户的 WMS 域名/内网地址无法预知,需在页面上识别运单号;实际只在白名单站点工作,其它站点立即退出且不读取 DOM。 | Customers' WMS hosts cannot be enumerated in advance. Matching only runs on an allow-listed site; otherwise the script exits without reading the DOM. |
| `host_permissions: https://pack.wms.gztbyc.com/*` | 只用于拉取只读配置与最新客户端版本信息。 | Fetches read-only configuration and the latest client version info. |
-| `host_permissions: http://localhost:17300/*`、`http://127.0.0.1:17300/*` | 与本机安装的桌面客户端通信(判断是否安装、传递运单号)。 | Talks to the desktop client installed on the same machine (availability probe and tracking-number hand-off). |
+| `host_permissions: http://localhost:16000/*`、`http://127.0.0.1:16000/*` | 与本机安装的桌面客户端通信(判断是否安装、传递运单号)。 | Talks to the desktop client installed on the same machine (availability probe and tracking-number hand-off). |
**数据使用声明(Data usage 表单)**:全部选「不收集」——
只做本地匹配;不收集浏览历史、页面内容、个人身份信息、位置、财务信息;
@@ -166,7 +166,7 @@ Policy: https://pack.wms.gztbyc.com/extension-privacy.html
## 8. 提交时逐字段对照表(Package 上传之后)
上传包后,`Packages` 那张表应显示:`YuncangTraceExtension-.zip`、版本号、**Status = Complete**、
-权限识别为 `storage, alarms, http://localhost:17300/*, http://127.0.0.1:17300/*, https://pack.wms.gztbyc.com/*`。
+权限识别为 `storage, alarms, http://localhost:16000/*, http://127.0.0.1:16000/*, https://pack.wms.gztbyc.com/*`。
> `Languages in package:` 为空是**正常**的(包内没有 `_locales` 多语言资源);商店页面的语言在
> Store listing 里单独选,不影响审核。
diff --git a/extension/manifest.json b/extension/manifest.json
index 071c680..3361466 100644
--- a/extension/manifest.json
+++ b/extension/manifest.json
@@ -15,8 +15,8 @@
"permissions": ["storage", "alarms"],
"host_permissions": [
- "http://localhost:17300/*",
- "http://127.0.0.1:17300/*",
+ "http://localhost:16000/*",
+ "http://127.0.0.1:16000/*",
"https://pack.wms.gztbyc.com/*"
],
diff --git a/extension/src/background.js b/extension/src/background.js
index 169ee1a..cb83f94 100644
--- a/extension/src/background.js
+++ b/extension/src/background.js
@@ -73,13 +73,13 @@ chrome.runtime.onMessage.addListener((msg, sender, sendResponse) => {
*
* 为什么不去看「页面有没有失焦」:软件已经在跑时,协议只是把参数转给已有实例,
* 窗口可能不抢焦点;冷启动也可能超过几秒 —— 两种都会误报「没打开」。
- * 但软件只要在跑就一定监听 17300,**任何 HTTP 响应(200/400/401)都算成功**。
+ * 但软件只要在跑就一定监听 16000,**任何 HTTP 响应(200/400/401)都算成功**。
*/
async function probeLocalService(timeoutMs = 1500) {
const controller = new AbortController();
const timer = setTimeout(() => controller.abort(), timeoutMs);
try {
- const res = await fetch('http://localhost:17300/api/query/', {
+ const res = await fetch('http://localhost:16000/api/query/', {
cache: 'no-store',
signal: controller.signal,
});
diff --git a/extension/src/content.js b/extension/src/content.js
index 3353722..4486aac 100644
--- a/extension/src/content.js
+++ b/extension/src/content.js
@@ -248,7 +248,7 @@
window.addEventListener('blur', onLeave);
document.addEventListener('visibilitychange', onLeave);
- // 更可靠的判据:本机服务是否有响应(软件在跑就一定监听 17300)。
+ // 更可靠的判据:本机服务是否有响应(软件在跑就一定监听 16000)。
// 仅看「页面失焦」会误报:软件本来就在跑时只是转发参数,窗口不一定抢焦点。
const timer = setInterval(async () => {
if (settled) return;
diff --git a/frontend/.env.production b/frontend/.env.production
index c2b6c09..fca5767 100644
--- a/frontend/.env.production
+++ b/frontend/.env.production
@@ -3,10 +3,10 @@
# 生产由后端同源托管页面与 /api,所以 API_BASE 留空即可。
VITE_API_BASE=
-# 本机桌面端约定:yuncang:// 协议 + HTTP 17300 + WebSocket 17301
+# 本机桌面端约定:yuncang:// 协议 + HTTP 16000 + WebSocket 16001
VITE_APP_PROTOCOL=yuncang
-VITE_LOCAL_SERVICE=http://localhost:17300
-VITE_LOCAL_WS=ws://127.0.0.1:17301/
+VITE_LOCAL_SERVICE=http://localhost:16000
+VITE_LOCAL_WS=ws://127.0.0.1:16001/
# /download/version.json 取不到时的兜底安装包地址(留空则只依赖 version.json)
VITE_SOFTWARE_DOWNLOAD_URL=
diff --git a/frontend/public/extension-privacy.html b/frontend/public/extension-privacy.html
index 2ea0241..fd73bce 100644
--- a/frontend/public/extension-privacy.html
+++ b/frontend/public/extension-privacy.html
@@ -53,7 +53,7 @@
| 匹配到的运单号 |
- 当你点击该运单号时,运单号会通过本机回环地址 http://localhost:17300
+ | 当你点击该运单号时,运单号会通过本机回环地址 http://localhost:16000
交给同一台电脑上已安装的「云仓视频溯源」桌面客户端(不经过互联网)。
若未安装客户端,则按管理员配置的模板在浏览器里打开溯源页面。 |
@@ -88,7 +88,7 @@
因此需要在页面上识别运单号。只有在管理员配置的站点白名单内才会工作;
其它站点上脚本立即退出,不读取也不改动页面。
https://pack.wms.gztbyc.com | 拉取上述只读配置与客户端版本信息。 |
- http://localhost:17300、http://127.0.0.1:17300 |
+
http://localhost:16000、http://127.0.0.1:16000 |
与本机安装的桌面客户端通信(判断是否已安装、传递运单号)。 |
diff --git a/frontend/src/api/local.ts b/frontend/src/api/local.ts
index 23a5a7c..12a9d1a 100644
--- a/frontend/src/api/local.ts
+++ b/frontend/src/api/local.ts
@@ -1,19 +1,19 @@
/**
- * 本机软件 HTTP 客户端(17300)
+ * 本机软件 HTTP 客户端(16000)
*
* 现在 HTTP 只负责**低频、无状态**的事,剩三个接口:
* - `GET /api/query/{code}` 查信息,**同时返回服务/登录状态**(没登录回 401 `state:need-login`)
* - `POST /api/activate-login` 把本机软件的登录窗/主界面叫到前台
* - `POST /api/playback/download` 按运单下载录像
*
- * ⚠️ 海康相关(拉通道 / 实时预览 / 云台 / 满帧率窗口)**全部走 WebSocket 17301**,
+ * ⚠️ 海康相关(拉通道 / 实时预览 / 云台 / 满帧率窗口)**全部走 WebSocket 16001**,
* 见 {@link ./localWs.ts};这里只留通道列表的类型,供那边的返回值复用。
*
* 为什么不再单独做探活接口:探活通过 ≠ 真正查询时软件还在(用户可能中途退了),
* 两次请求之间的状态可能已经变了。合并成一个接口后,页面只发一次请求就能决定
* 「展示结果」还是「提示可以唤起」。
*
- * ⚠️ 这是**跨域**请求(页面同源是我们的站点,目标是 localhost:17300):
+ * ⚠️ 这是**跨域**请求(页面同源是我们的站点,目标是 localhost:16000):
* 本机软件必须允许 CORS(`Access-Control-Allow-Origin` 放行站点来源),否则浏览器会拦掉,
* 表现和「软件没启动」一样 —— 页面统一提示「服务暂不可用」。
*
@@ -21,7 +21,7 @@
*/
/** 本机服务地址(去掉末尾斜杠) */
-export const LOCAL_BASE = ((import.meta.env.VITE_LOCAL_SERVICE as string | undefined) || 'http://localhost:17300')
+export const LOCAL_BASE = ((import.meta.env.VITE_LOCAL_SERVICE as string | undefined) || 'http://localhost:16000')
.replace(/\/+$/, '');
/** 本机服务返回非 2xx / 超时 / 跨域失败时抛它 */
diff --git a/frontend/src/api/localWs.ts b/frontend/src/api/localWs.ts
index 6ca1653..c463d7d 100644
--- a/frontend/src/api/localWs.ts
+++ b/frontend/src/api/localWs.ts
@@ -1,7 +1,7 @@
/**
* 本机软件的 WebSocket 通道(实时预览 / 云台 / 拉通道)
*
- * 端口约定:本机桌面端 `LocalWsServer` 监听 **17301**(可用 `VITE_LOCAL_WS` 覆盖)。
+ * 端口约定:本机桌面端 `LocalWsServer` 监听 **16001**(可用 `VITE_LOCAL_WS` 覆盖)。
*
* 协议(服务端见 `desktop/Services/LocalWsServer.cs`):
* - 文本:`{ id, action, ... }` → 回复 `{ id, ok, data | message }`
@@ -16,7 +16,7 @@ import { launchApp } from '@/api/local';
import type { HikChannelsPayload } from '@/api/local';
/** WS 地址 */
-export const LOCAL_WS = (import.meta.env.VITE_LOCAL_WS as string | undefined) || 'ws://127.0.0.1:17301/';
+export const LOCAL_WS = (import.meta.env.VITE_LOCAL_WS as string | undefined) || 'ws://127.0.0.1:16001/';
/** 云台连续动作(方向 / 变倍 / 聚焦 / 光圈 / 自动扫描) */
export type WsPtzCommand =
diff --git a/frontend/src/components/LocalServiceGate.vue b/frontend/src/components/LocalServiceGate.vue
index 9ad62e3..c8811a2 100644
--- a/frontend/src/components/LocalServiceGate.vue
+++ b/frontend/src/components/LocalServiceGate.vue
@@ -2,7 +2,7 @@
/**
* 「连接不上本机软件」统一提示窗
*
- * 网页的拉通道 / 实时预览 / 云台都依赖本机软件(HTTP 17300 + WebSocket 17301),
+ * 网页的拉通道 / 实时预览 / 云台都依赖本机软件(HTTP 16000 + WebSocket 16001),
* 浏览器没法判断到底是「没安装」还是「装了没启动」,所以统一弹这个:
* - **启动本机软件**:用 `yuncang://` 协议唤起,再等 WS 连上(连上就 emit `ready` 让调用方重试);
* - **立即下载**:后端 `version.json` 里的最新安装包(拿不到就退回环境变量兜底地址)。
@@ -25,7 +25,7 @@ const props = withDefaults(defineProps<{
message?: string;
/** 唤起后最多等多久(毫秒) */
waitMs?: number;
- /** 探活方式:ws = WebSocket 17301(预览类);http = HTTP 17300 根路径(查件页,兼容老版本) */
+ /** 探活方式:ws = WebSocket 16001(预览类);http = HTTP 16000 根路径(查件页,兼容老版本) */
probe?: 'ws' | 'http';
}>(), {
title: '连接不上本机软件',
@@ -56,7 +56,7 @@ watch(() => props.open, async open => {
async function probeReady(): Promise {
if (props.probe === 'http') {
- // 查件页走 HTTP 17300(老版本软件也有这个端口,但不一定有 WS)
+ // 查件页走 HTTP 16000(老版本软件也有这个端口,但不一定有 WS)
const deadline = Date.now() + props.waitMs;
while (Date.now() < deadline) {
try {
diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts
index a3deb2a..c34c36a 100644
--- a/frontend/src/router/index.ts
+++ b/frontend/src/router/index.ts
@@ -24,7 +24,7 @@ const routes: RouteRecordRaw[] = [
// 手机扫码后打开:确认登录(公开)
{ path: '/wechat', name: 'wechat-confirm', component: () => import('@/views/WechatConfirmView.vue'), meta: { public: true, bare: true } },
// 本机软件(打印服务)公共页:**不需要登录**,Chrome 插件打开 `/local?code=<运单号>`
- // 页面自己查 http://localhost:17300/api/query/{code}(状态和结果一起回来),
+ // 页面自己查 http://localhost:16000/api/query/{code}(状态和结果一起回来),
// 没启动就提示下载/唤起,没登录就唤起软件登录
{
path: '/local',
diff --git a/frontend/src/utils/localSoftware.ts b/frontend/src/utils/localSoftware.ts
index b10f636..7fc9bca 100644
--- a/frontend/src/utils/localSoftware.ts
+++ b/frontend/src/utils/localSoftware.ts
@@ -29,8 +29,8 @@ export interface SoftwareRelease {
/** 兜底下载地址(后端没放 version.json 时用) */
const FALLBACK_DOWNLOAD_URL = (import.meta.env.VITE_SOFTWARE_DOWNLOAD_URL as string | undefined) || '';
-// 探活统一走 `waitForLocalWs()`(api/localWs.ts):预览/云台/拉通道都在 17301,
-// 还走 HTTP 17300 探活会出现「HTTP 起来了但预览通道没起来」的错位。
+// 探活统一走 `waitForLocalWs()`(api/localWs.ts):预览/云台/拉通道都在 16001,
+// 还走 HTTP 16000 探活会出现「HTTP 起来了但预览通道没起来」的错位。
/** 用自定义协议唤起本机软件(必须在用户手势里调用) */
export function launchLocalSoftware(): void {
diff --git a/frontend/src/views/CamerasView.vue b/frontend/src/views/CamerasView.vue
index 6414bb3..6d53e22 100644
--- a/frontend/src/views/CamerasView.vue
+++ b/frontend/src/views/CamerasView.vue
@@ -341,7 +341,7 @@ async function openPreview(camera: Camera, streamType = previewStreamType.value)
// 子码流走 SDK 取流 + PlayM4 解码(640×360、25fps)。
const mode = streamType === 0 ? 'ffmpeg' : 'stream';
- // 预览**只走本机 WebSocket(17301)**:二进制 JPEG 帧,一条连接可同时推多路。
+ // 预览**只走本机 WebSocket(16001)**:二进制 JPEG 帧,一条连接可同时推多路。
try {
await localWs.connect(2500);
} catch {
diff --git a/frontend/src/views/LocalServiceView.vue b/frontend/src/views/LocalServiceView.vue
index 8a3cf6a..fe91216 100644
--- a/frontend/src/views/LocalServiceView.vue
+++ b/frontend/src/views/LocalServiceView.vue
@@ -312,7 +312,7 @@ onMounted(load);
-
+