docs: 架构设计文档和Agents.md增加前端部署路径设计
1. 架构设计文档 v1.6 -> v1.7 新增 6.1 前端部署路径设计章节: - 6.1.1 部署路径规划表 - 6.1.2 Nginx配置示例 - 6.1.3 前端构建配置(VITE_BASE等) - 6.1.4 API请求路径规范 - 原有章节编号顺延(6.1->6.3, 6.2->6.4) 2. Agents.md v1.1 -> v1.2 15.2 访问地址 改为 15.2 前端部署路径: - 新增前端部署路径规划表 - 补充移动端H5开发环境访问地址
This commit is contained in:
parent
f8e0a51314
commit
610054918a
17
Agents.md
17
Agents.md
@ -1,8 +1,8 @@
|
|||||||
# 资金服务平台 (FundPlatform) - 开发规范
|
# 资金服务平台 (FundPlatform) - 开发规范
|
||||||
|
|
||||||
> **文档版本**: v1.1
|
> **文档版本**: v1.2
|
||||||
> **创建日期**: 2026-02-20
|
> **创建日期**: 2026-02-20
|
||||||
> **更新日期**: 2026-02-13
|
> **更新日期**: 2026-02-23
|
||||||
> **适用范围**: 本项目所有开发人员
|
> **适用范围**: 本项目所有开发人员
|
||||||
|
|
||||||
---
|
---
|
||||||
@ -911,11 +911,22 @@ public class TokenAuthFilter implements GlobalFilter {
|
|||||||
| `TENANT_ID` | 租户标识 | 空值=共享实例,有值=VIP实例 |
|
| `TENANT_ID` | 租户标识 | 空值=共享实例,有值=VIP实例 |
|
||||||
| `SERVER_PORT` | 服务端口 | 可选,覆盖application.yml |
|
| `SERVER_PORT` | 服务端口 | 可选,覆盖application.yml |
|
||||||
|
|
||||||
### 15.2 访问地址
|
### 15.2 前端部署路径
|
||||||
|
|
||||||
|
前端项目采用 **Nginx 子路径部署** 模式:
|
||||||
|
|
||||||
|
| 前端项目 | 部署路径 | 访问地址 | 说明 |
|
||||||
|
|----------|----------|----------|------|
|
||||||
|
| fund-admin | `/fadmin/` | `http://host/fadmin/` | 管理后台 |
|
||||||
|
| fund-mobile | `/fmobile/` | `http://host/fmobile/` | 移动端H5 |
|
||||||
|
| API网关 | `/fund/` | `http://host/fund/` | 后端API统一前缀 |
|
||||||
|
|
||||||
|
**开发环境访问地址**:
|
||||||
|
|
||||||
| 服务 | 地址 |
|
| 服务 | 地址 |
|
||||||
|------|------|
|
|------|------|
|
||||||
| 管理后台 | http://localhost:3000 |
|
| 管理后台 | http://localhost:3000 |
|
||||||
|
| 移动端H5 | http://localhost:8080 |
|
||||||
| API网关 | http://localhost:8000 |
|
| API网关 | http://localhost:8000 |
|
||||||
| Nacos控制台 | http://localhost:8048/nacos |
|
| Nacos控制台 | http://localhost:8048/nacos |
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
# 资金服务平台 (FundPlatform) - 架构设计文档
|
# 资金服务平台 (FundPlatform) - 架构设计文档
|
||||||
|
|
||||||
> **文档版本**: v1.6
|
> **文档版本**: v1.7
|
||||||
> **创建日期**: 2026-02-13
|
> **创建日期**: 2026-02-13
|
||||||
> **更新日期**: 2026-02-13
|
> **更新日期**: 2026-02-23
|
||||||
> **项目名称**: 资金服务平台
|
> **项目名称**: 资金服务平台
|
||||||
> **项目代号**: fundplatform
|
> **项目代号**: fundplatform
|
||||||
|
|
||||||
@ -3460,7 +3460,98 @@ public class UserController {
|
|||||||
|
|
||||||
## 六、部署架构
|
## 六、部署架构
|
||||||
|
|
||||||
### 6.1 生产环境部署
|
### 6.1 前端部署路径设计
|
||||||
|
|
||||||
|
前端项目采用 **Nginx 子路径部署** 模式,通过统一的 Nginx 入口提供静态资源服务。
|
||||||
|
|
||||||
|
#### 6.1.1 部署路径规划
|
||||||
|
|
||||||
|
| 前端项目 | 部署路径 | 访问地址 | 说明 |
|
||||||
|
|----------|----------|----------|------|
|
||||||
|
| fund-admin | `/fadmin/` | `http://host/fadmin/` | 管理后台 |
|
||||||
|
| fund-mobile | `/fmobile/` | `http://host/fmobile/` | 移动端H5 |
|
||||||
|
| API网关 | `/fund/` | `http://host/fund/` | 后端API统一前缀 |
|
||||||
|
|
||||||
|
#### 6.1.2 Nginx 配置示例
|
||||||
|
|
||||||
|
```nginx
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name localhost;
|
||||||
|
|
||||||
|
# 管理后台前端 (部署路径: /fadmin/)
|
||||||
|
location /fadmin/ {
|
||||||
|
alias /opt/fundplatform/web/admin/;
|
||||||
|
try_files $uri $uri/ /fadmin/index.html;
|
||||||
|
}
|
||||||
|
|
||||||
|
# 移动端H5 (部署路径: /fmobile/)
|
||||||
|
location /fmobile/ {
|
||||||
|
alias /opt/fundplatform/web/mobile/;
|
||||||
|
try_files $uri $uri/ /fmobile/index.html;
|
||||||
|
}
|
||||||
|
|
||||||
|
# API代理 (网关前缀: /fund)
|
||||||
|
location /fund/ {
|
||||||
|
proxy_pass http://127.0.0.1:8000/;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 6.1.3 前端构建配置
|
||||||
|
|
||||||
|
前端项目需配置 `VITE_BASE` 环境变量以支持子路径部署:
|
||||||
|
|
||||||
|
**fund-admin/.env.production**:
|
||||||
|
```properties
|
||||||
|
VITE_BASE=/fadmin/
|
||||||
|
VITE_API_BASE_URL=/fund
|
||||||
|
```
|
||||||
|
|
||||||
|
**fund-mobile/.env.production**:
|
||||||
|
```properties
|
||||||
|
VITE_BASE=/fmobile/
|
||||||
|
VITE_API_BASE_URL=/fund
|
||||||
|
```
|
||||||
|
|
||||||
|
**vite.config.ts** 配置动态 base 路径:
|
||||||
|
```typescript
|
||||||
|
export default defineConfig(({ mode }) => {
|
||||||
|
const env = loadEnv(mode, process.cwd())
|
||||||
|
const base = env.VITE_BASE || '/'
|
||||||
|
return {
|
||||||
|
base,
|
||||||
|
// ...其他配置
|
||||||
|
}
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
**Vue Router** 配置动态 base 路径:
|
||||||
|
```typescript
|
||||||
|
const router = createRouter({
|
||||||
|
history: createWebHistory(import.meta.env.BASE_URL),
|
||||||
|
routes
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 6.1.4 API请求路径规范
|
||||||
|
|
||||||
|
前端所有API请求统一使用网关前缀 `/fund`,由Gateway转发到后端服务:
|
||||||
|
|
||||||
|
```
|
||||||
|
前端请求 Gateway转发 后端服务
|
||||||
|
/fund/auth/login -> /api/v1/auth/login -> fund-sys
|
||||||
|
/fund/customer/page -> /api/v1/customer/page -> fund-cust
|
||||||
|
/fund/project/page -> /api/v1/project/page -> fund-proj
|
||||||
|
/fund/exp/expense -> /api/v1/exp/expense -> fund-exp
|
||||||
|
/fund/receipt/receivable -> /api/v1/receipt/receivable -> fund-receipt
|
||||||
|
```
|
||||||
|
|
||||||
|
### 6.3 生产环境部署
|
||||||
|
|
||||||
```
|
```
|
||||||
┌─────────────────────────────────────────────────────────────────┐
|
┌─────────────────────────────────────────────────────────────────┐
|
||||||
@ -3511,9 +3602,9 @@ public class UserController {
|
|||||||
└─────────────────────────────────────────────────────────────────┘
|
└─────────────────────────────────────────────────────────────────┘
|
||||||
```
|
```
|
||||||
|
|
||||||
### 6.2 容器化部署
|
### 6.4 容器化部署
|
||||||
|
|
||||||
#### 6.2.1 Docker Compose 配置
|
#### 6.4.1 Docker Compose 配置
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
version: '3.8'
|
version: '3.8'
|
||||||
@ -3978,6 +4069,7 @@ public class GlobalExceptionHandler {
|
|||||||
| v1.4 | 2026-02-13 | 补充统一全局上下文 GlobalContext,统筹 tid/uid/uname 获取和异步传递 | zhangjf |
|
| v1.4 | 2026-02-13 | 补充统一全局上下文 GlobalContext,统筹 tid/uid/uname 获取和异步传递 | zhangjf |
|
||||||
| v1.5 | 2026-02-13 | 补充模块通信与 OpenFeign 参数对象管理策略、分层架构职责说明、MyBatis-Plus 使用规范、Controller 与参数校验规范、事务与测试规范及开发规则总览 | zhangjf |
|
| v1.5 | 2026-02-13 | 补充模块通信与 OpenFeign 参数对象管理策略、分层架构职责说明、MyBatis-Plus 使用规范、Controller 与参数校验规范、事务与测试规范及开发规则总览 | zhangjf |
|
||||||
| v1.6 | 2026-02-13 | 补充单机部署配置:配置文件分离架构(env.properties+service.properties)、打包目录结构、多租户部署配置、日志配置集中化、脚本加载逻辑 | zhangjf |
|
| v1.6 | 2026-02-13 | 补充单机部署配置:配置文件分离架构(env.properties+service.properties)、打包目录结构、多租户部署配置、日志配置集中化、脚本加载逻辑 | zhangjf |
|
||||||
|
| v1.7 | 2026-02-23 | 新增6.1前端部署路径设计:Nginx子路径部署、部署路径规划、Nginx配置示例、前端构建配置、API请求路径规范 | zhangjf |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user