From a8469d1916ea8b1112d5509b10e38422d3a9b9f9 Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Tue, 30 Jun 2026 23:15:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=BE=E5=BC=80=E5=BA=97=E5=8A=A1=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E5=BC=80=E5=8F=91=E8=AE=BF=E9=97=AE=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JY-Salon-Front/vite.config.ts | 4 ++-- scripts/JY-Salon-Front开发后端地址配置说明_20260630.md | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/JY-Salon-Front/vite.config.ts b/JY-Salon-Front/vite.config.ts index 2189819f..39f33eb3 100644 --- a/JY-Salon-Front/vite.config.ts +++ b/JY-Salon-Front/vite.config.ts @@ -17,7 +17,7 @@ export default defineConfig(({ mode }) => { }, server: { port: 3001, - host: true, + host: '0.0.0.0', proxy: { '/admin/api': { target: proxyTarget, @@ -30,7 +30,7 @@ export default defineConfig(({ mode }) => { rewrite: targetPath => proxyToCoreDirectly ? targetPath.replace(/^\/api/, '') : targetPath } }, - allowedHosts: ['localhost', '127.0.0.1', '2666.online', 'wcy111.top'] + allowedHosts: true } } }) diff --git a/scripts/JY-Salon-Front开发后端地址配置说明_20260630.md b/scripts/JY-Salon-Front开发后端地址配置说明_20260630.md index ef684b6d..77218e4c 100644 --- a/scripts/JY-Salon-Front开发后端地址配置说明_20260630.md +++ b/scripts/JY-Salon-Front开发后端地址配置说明_20260630.md @@ -18,6 +18,8 @@ VITE_DEV_PROXY_TARGET=http://dev.yunail.art:18888 前端代码仍然使用 `/api` 和 `/admin/api` 作为请求前缀,由 Vite 在开发环境中转发到上述地址。 +开发服务监听所有网卡地址,不限制为本机访问。局域网或隧道访问时仍使用相同的 `/jy-salon-front/` 基础路径。 + ## 验证方式 启动店务前端后验证: @@ -27,3 +29,11 @@ GET http://127.0.0.1:3001/api/legal-agreement/current ``` 应返回 `200`,并由 `dev.yunail.art:18888` 后端提供响应。 + +确认监听地址: + +```text +netstat -ano | findstr :3001 +``` + +应显示 `0.0.0.0:3001` 或等效的全地址监听。