diff --git a/urbanLifelineWeb/NGINX_SSO_CONFIG.md b/urbanLifelineWeb/NGINX_SSO_CONFIG.md index 4f96ff39..b0f85133 100644 --- a/urbanLifelineWeb/NGINX_SSO_CONFIG.md +++ b/urbanLifelineWeb/NGINX_SSO_CONFIG.md @@ -55,17 +55,17 @@ pnpm build ```nginx # Platform 主应用(单点登录入口) location / { - proxy_pass http://localhost:5001/; + proxy_pass http://localhost:7001/; } # Workcase 工单服务 location /workcase/ { - proxy_pass http://localhost:5003/; + proxy_pass http://localhost:7003/; } # Bidding 招标服务 location /bidding/ { - proxy_pass http://localhost:5002/; + proxy_pass http://localhost:7002/; } # 后端 API 统一入口 @@ -221,12 +221,12 @@ addDynamicRoutes(workcaseViews) - 修改 `devConfig.sso` 为绝对URL ```typescript sso: { - platformUrl: 'http://localhost:5001', - workcaseUrl: 'http://localhost:5003', - biddingUrl: 'http://localhost:5002' + platformUrl: 'http://localhost:7001', + workcaseUrl: 'http://localhost:7003', + biddingUrl: 'http://localhost:7002' } ``` -- 直接访问 http://localhost:5001, http://localhost:5003 +- 直接访问 http://localhost:7001, http://localhost:7003 ## 常见问题 diff --git a/urbanLifelineWeb/README.md b/urbanLifelineWeb/README.md index 6be7dfc7..0df50980 100644 --- a/urbanLifelineWeb/README.md +++ b/urbanLifelineWeb/README.md @@ -40,11 +40,11 @@ pnpm run dev # 方式3: 手动启动(需要两个终端) # 终端1 - 启动 shared cd packages/shared -pnpm run dev # http://localhost:5000 +pnpm run dev # http://localhost:7000 # 终端2 - 启动 platform cd packages/platform -pnpm run dev # http://localhost:5001 +pnpm run dev # http://localhost:7001 ``` ### 3. 构建生产版本 @@ -110,7 +110,7 @@ export default defineConfig({ }) ], server: { - port: 5000, + port: 7000, strictPort: true, // 关键:锁定端口,避免漂移 host: true, cors: true @@ -131,7 +131,7 @@ export default defineConfig({ shared: { type: 'module', // 关键:必须指定 ES module 类型 name: 'shared', - entry: 'http://localhost:5000/remoteEntry.js' + entry: 'http://localhost:7000/remoteEntry.js' } }, shared: { @@ -230,4 +230,4 @@ const result = await authAPI.login(params) 2. **启动顺序**: 必须先启动 `shared` 服务(5000端口),再启动其他应用 3. **端口占用**: 确保 5000-5003 端口未被占用,shared 使用 strictPort 模式 4. **Node 版本**: 建议使用 Node.js 18+ -5. **Module Federation**: remoteEntry.js 路径为 `http://localhost:5000/remoteEntry.js`(不是 /assets/) +5. **Module Federation**: remoteEntry.js 路径为 `http://localhost:7000/remoteEntry.js`(不是 /assets/) diff --git a/urbanLifelineWeb/packages/bidding/index.html b/urbanLifelineWeb/packages/bidding/index.html index b9088bfd..7a7c8d12 100644 --- a/urbanLifelineWeb/packages/bidding/index.html +++ b/urbanLifelineWeb/packages/bidding/index.html @@ -13,18 +13,18 @@ - - + +
diff --git a/urbanLifelineWeb/packages/bidding/vite.config.ts b/urbanLifelineWeb/packages/bidding/vite.config.ts index 3c3df7f2..ff110c70 100644 --- a/urbanLifelineWeb/packages/bidding/vite.config.ts +++ b/urbanLifelineWeb/packages/bidding/vite.config.ts @@ -34,7 +34,7 @@ export default defineConfig(({ mode }) => ({ }, server: { - port: 5002, + port: 7002, host: true, cors: true, open: '/bidding/', // 开发时自动打开到 /bidding/ 路径 @@ -46,7 +46,7 @@ export default defineConfig(({ mode }) => ({ }, // 代理共享模块请求到 shared 服务 '/shared': { - target: 'http://localhost:5000', + target: 'http://localhost:7000', changeOrigin: true } } diff --git a/urbanLifelineWeb/packages/platform/package.json b/urbanLifelineWeb/packages/platform/package.json index e7d3f995..0e6f8b71 100644 --- a/urbanLifelineWeb/packages/platform/package.json +++ b/urbanLifelineWeb/packages/platform/package.json @@ -4,9 +4,9 @@ "type": "module", "private": true, "scripts": { - "dev": "vite --port 5001 --host", + "dev": "vite --host", "build": "vue-tsc && vite build", - "preview": "vite preview --port 5001" + "preview": "vite preview" }, "dependencies": { "vue": "^3.5.13", diff --git a/urbanLifelineWeb/packages/platform/src/layouts/AdminIframeSidebarLayout/README.md b/urbanLifelineWeb/packages/platform/src/layouts/AdminIframeSidebarLayout/README.md index c05051ff..8279319f 100644 --- a/urbanLifelineWeb/packages/platform/src/layouts/AdminIframeSidebarLayout/README.md +++ b/urbanLifelineWeb/packages/platform/src/layouts/AdminIframeSidebarLayout/README.md @@ -25,14 +25,14 @@ const menuItems: MenuItem[] = [ key: 'bidding', label: '招标助手', icon: 'Document', - iframeUrl: 'http://localhost:5002', + iframeUrl: 'http://localhost:7002', type: 'iframe' }, { key: 'service', label: '泰豪小电', icon: 'Service', - iframeUrl: 'http://localhost:5003', + iframeUrl: 'http://localhost:7003', type: 'iframe' }, { @@ -100,12 +100,12 @@ interface MenuItem { ### 1. 招标助手 (Bidding) - **端口**:5002 -- **URL**:http://localhost:5002 +- **URL**:http://localhost:7002 - **说明**:招投标业务管理系统 ### 2. 泰豪小电 (Service) - **端口**:5003 -- **URL**:http://localhost:5003 +- **URL**:http://localhost:7003 - **说明**:智能客服工单管理系统 ### 3. 智能体编排 (Workflow) @@ -165,7 +165,7 @@ interface MenuItem { # nginx 配置 add_header X-Frame-Options "SAMEORIGIN"; # 或者 - add_header Content-Security-Policy "frame-ancestors 'self' http://localhost:5001"; + add_header Content-Security-Policy "frame-ancestors 'self' http://localhost:7001"; ``` 2. **端口配置**:确保对应服务已启动 @@ -188,7 +188,7 @@ interface MenuItem { key: 'new-app', label: '新应用', icon: 'Plus', - iframeUrl: 'http://localhost:5004', + iframeUrl: 'http://localhost:7004', type: 'iframe' } ``` diff --git a/urbanLifelineWeb/packages/platform/src/layouts/SidebarLayout/README.md b/urbanLifelineWeb/packages/platform/src/layouts/SidebarLayout/README.md index c05051ff..8279319f 100644 --- a/urbanLifelineWeb/packages/platform/src/layouts/SidebarLayout/README.md +++ b/urbanLifelineWeb/packages/platform/src/layouts/SidebarLayout/README.md @@ -25,14 +25,14 @@ const menuItems: MenuItem[] = [ key: 'bidding', label: '招标助手', icon: 'Document', - iframeUrl: 'http://localhost:5002', + iframeUrl: 'http://localhost:7002', type: 'iframe' }, { key: 'service', label: '泰豪小电', icon: 'Service', - iframeUrl: 'http://localhost:5003', + iframeUrl: 'http://localhost:7003', type: 'iframe' }, { @@ -100,12 +100,12 @@ interface MenuItem { ### 1. 招标助手 (Bidding) - **端口**:5002 -- **URL**:http://localhost:5002 +- **URL**:http://localhost:7002 - **说明**:招投标业务管理系统 ### 2. 泰豪小电 (Service) - **端口**:5003 -- **URL**:http://localhost:5003 +- **URL**:http://localhost:7003 - **说明**:智能客服工单管理系统 ### 3. 智能体编排 (Workflow) @@ -165,7 +165,7 @@ interface MenuItem { # nginx 配置 add_header X-Frame-Options "SAMEORIGIN"; # 或者 - add_header Content-Security-Policy "frame-ancestors 'self' http://localhost:5001"; + add_header Content-Security-Policy "frame-ancestors 'self' http://localhost:7001"; ``` 2. **端口配置**:确保对应服务已启动 @@ -188,7 +188,7 @@ interface MenuItem { key: 'new-app', label: '新应用', icon: 'Plus', - iframeUrl: 'http://localhost:5004', + iframeUrl: 'http://localhost:7004', type: 'iframe' } ``` diff --git a/urbanLifelineWeb/packages/platform/vite.config.ts b/urbanLifelineWeb/packages/platform/vite.config.ts index 5fdf19e9..43d9ac8c 100644 --- a/urbanLifelineWeb/packages/platform/vite.config.ts +++ b/urbanLifelineWeb/packages/platform/vite.config.ts @@ -26,7 +26,7 @@ export default defineConfig({ shared: { type: 'module', name: 'shared', - entry: 'http://localhost:5000/remoteEntry.js' + entry: 'http://localhost:7000/remoteEntry.js' } }, shared: { @@ -51,7 +51,7 @@ export default defineConfig({ }, server: { - port: 5001, + port: 7001, host: true, cors: true, open: '/', // 开发时自动打开到根路径 diff --git a/urbanLifelineWeb/packages/shared/src/config/index.ts b/urbanLifelineWeb/packages/shared/src/config/index.ts index 830d90f9..4721e4b4 100644 --- a/urbanLifelineWeb/packages/shared/src/config/index.ts +++ b/urbanLifelineWeb/packages/shared/src/config/index.ts @@ -100,7 +100,7 @@ const devConfig: AppRuntimeConfig = { // 单点登录配置 // 推荐:开发环境也通过nginx访问(http://localhost) - // 备选:直接访问各服务端口(platformUrl: 'http://localhost:5001') + // 备选:直接访问各服务端口(platformUrl: 'http://localhost:7001') sso: { platformUrl: '/', // 通过nginx访问platform workcaseUrl: '/workcase', // 通过nginx访问workcase diff --git a/urbanLifelineWeb/packages/shared/vite.config.ts b/urbanLifelineWeb/packages/shared/vite.config.ts index 8804924c..4a2491b6 100644 --- a/urbanLifelineWeb/packages/shared/vite.config.ts +++ b/urbanLifelineWeb/packages/shared/vite.config.ts @@ -100,7 +100,7 @@ export default defineConfig({ }, server: { - port: 5000, + port: 7000, strictPort: true, host: true, cors: true, @@ -112,7 +112,7 @@ export default defineConfig({ }, preview: { - port: 5000, + port: 7000, host: true, cors: true, headers: { diff --git a/urbanLifelineWeb/packages/workcase/.__mf__temp/workcase/localSharedImportMap.js b/urbanLifelineWeb/packages/workcase/.__mf__temp/workcase/localSharedImportMap.js index f4045509..a3e0d379 100644 --- a/urbanLifelineWeb/packages/workcase/.__mf__temp/workcase/localSharedImportMap.js +++ b/urbanLifelineWeb/packages/workcase/.__mf__temp/workcase/localSharedImportMap.js @@ -118,7 +118,7 @@ entryGlobalName: "shared", name: "shared", type: "module", - entry: "http://localhost:5000/remoteEntry.js", + entry: "http://localhost:7000/remoteEntry.js", shareScope: "default", } diff --git a/urbanLifelineWeb/packages/workcase/package.json b/urbanLifelineWeb/packages/workcase/package.json index a7b89b79..fbd16a22 100644 --- a/urbanLifelineWeb/packages/workcase/package.json +++ b/urbanLifelineWeb/packages/workcase/package.json @@ -4,9 +4,9 @@ "type": "module", "private": true, "scripts": { - "dev": "vite --port 5003 --host", + "dev": "vite", "build": "vue-tsc && vite build", - "preview": "vite preview --port 5003" + "preview": "vite preview" }, "dependencies": { "vue": "^3.5.13", diff --git a/urbanLifelineWeb/packages/workcase/src/config.ts b/urbanLifelineWeb/packages/workcase/src/config.ts index 9fd99ffb..ba62b42b 100644 --- a/urbanLifelineWeb/packages/workcase/src/config.ts +++ b/urbanLifelineWeb/packages/workcase/src/config.ts @@ -19,7 +19,7 @@ export const API_BASE_URL = (import.meta as any).env?.VITE_API_BASE_URL || '/api * Platform URL(单点登录入口) * 开发环境: * - 通过nginx访问时使用 '/'(推荐) - * - 直接访问各服务时使用 'http://localhost:5001' + * - 直接访问各服务时使用 'http://localhost:7001' * 生产环境:统一使用 '/' */ export const PLATFORM_URL = (import.meta as any).env?.VITE_PLATFORM_URL || '/' diff --git a/urbanLifelineWeb/packages/workcase/src/views/public/Login/Login.vue b/urbanLifelineWeb/packages/workcase/src/views/public/Login/Login.vue index 078c2497..ef32d9d4 100644 --- a/urbanLifelineWeb/packages/workcase/src/views/public/Login/Login.vue +++ b/urbanLifelineWeb/packages/workcase/src/views/public/Login/Login.vue @@ -12,7 +12,7 @@ diff --git a/urbanLifelineWeb/packages/workcase/vite.config.ts b/urbanLifelineWeb/packages/workcase/vite.config.ts index 87aea47c..bb984564 100644 --- a/urbanLifelineWeb/packages/workcase/vite.config.ts +++ b/urbanLifelineWeb/packages/workcase/vite.config.ts @@ -26,7 +26,7 @@ export default defineConfig(({ mode }) => ({ shared: { type: 'module', name: 'shared', - entry: 'http://localhost:5000/remoteEntry.js' + entry: 'http://localhost:7000/remoteEntry.js' } }, shared: { @@ -51,7 +51,7 @@ export default defineConfig(({ mode }) => ({ }, server: { - port: 5003, + port: 7003, host: true, cors: true, open: '/workcase/', // 开发时自动打开到 /workcase/ 路径 @@ -63,7 +63,7 @@ export default defineConfig(({ mode }) => ({ }, // 代理共享模块请求到 shared 服务 '/shared': { - target: 'http://localhost:5000', + target: 'http://localhost:7000', changeOrigin: true } } diff --git a/urbanLifelineWeb/start-all.bat b/urbanLifelineWeb/start-all.bat index d42854fa..de15e020 100644 --- a/urbanLifelineWeb/start-all.bat +++ b/urbanLifelineWeb/start-all.bat @@ -4,10 +4,10 @@ echo Urban Lifeline Web - 启动所有服务 echo ==================================== echo. echo 端口分配: -echo Shared: http://localhost:5000 -echo Platform: http://localhost:5001 -echo Bidding: http://localhost:5002 -echo Workcase: http://localhost:5003 +echo Shared: http://localhost:7000 +echo Platform: http://localhost:7001 +echo Bidding: http://localhost:7002 +echo Workcase: http://localhost:7003 echo. echo 按 Ctrl+C 停止所有服务 echo ====================================