From 7536bfd75eb1396f7d61ef91ef1795f4aac9c8f6 Mon Sep 17 00:00:00 2001 From: DXC Date: Tue, 10 Mar 2026 09:59:49 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=BC=98=E5=8C=96=20Vite=20=E7=83=AD?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=85=8D=E7=BD=AE=EF=BC=8C=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=B1=80=E5=9F=9F=E7=BD=91=E5=8A=A8=E6=80=81=20IP=20=E8=AE=BF?= =?UTF-8?q?=E9=97=AE=E5=B9=B6=E4=BF=AE=E5=A4=8D=20wss=20=E8=B7=A8=E5=9F=9F?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inventory-web/vite.config.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/inventory-web/vite.config.ts b/inventory-web/vite.config.ts index 76052f0..99bf25e 100644 --- a/inventory-web/vite.config.ts +++ b/inventory-web/vite.config.ts @@ -18,6 +18,10 @@ export default defineConfig({ host: '0.0.0.0', port: 5173, https: true, // ★ [新增] 强制开启 HTTPS,否则浏览器会拦截摄像头 + hmr: { + protocol: 'wss', + clientPort: 5173 + }, proxy: { // 拦截所有以 /api 开头的请求 '/api': {