feat: 添加微信端 API 文档和字典表初始化脚本
- 新增 openapi-wx.yaml 文件,定义微信端接口文档,包括用户统计、token 刷新、微信登录和用户资料更新等接口。 - 新增 pocketbase.dictionary.js 脚本,用于初始化和校验字典表结构,确保与预期一致。
This commit is contained in:
@@ -320,6 +320,21 @@ VUE_APP_VERSION=1.0.0
|
||||
4. 前端生产环境接口地址统一使用:`https://bai-api.blv-oa.com/api`
|
||||
5. 后端对外公开地址统一使用 `APP_BASE_URL=https://bai-api.blv-oa.com`
|
||||
|
||||
### 大文件上传反向代理配置
|
||||
|
||||
如果 PocketBase 管理页或 hooks 页面需要上传较大的图片/视频附件,Nginx 需要同步放开请求体大小限制,否则浏览器会直接收到 `413 Content Too Large`,前端通常会看到 HTML 错页而不是 JSON。
|
||||
|
||||
建议在站点或对应 `location` 中增加:
|
||||
|
||||
```nginx
|
||||
client_max_body_size 200m;
|
||||
proxy_request_buffering off;
|
||||
proxy_read_timeout 600s;
|
||||
proxy_send_timeout 600s;
|
||||
```
|
||||
|
||||
如果当前 `tbl_attachments.attachments_link` 已放宽到约 4GB,反向代理层仍然需要按你的目标上传体积同步放开,否则即使 PocketBase 集合字段允许更大文件,上传仍会在进入 PocketBase 之前被拦截。
|
||||
|
||||
## 数据库配置
|
||||
|
||||
### Pocketbase设置
|
||||
@@ -450,4 +465,4 @@ docker logs -f 容器名称
|
||||
|
||||
## 总结
|
||||
|
||||
本部署方案采用Docker容器化部署,实现了前后端分离的架构,支持一键部署和自动化管理。通过宝塔面板的反向代理功能,实现了域名访问和SSL证书配置,为系统提供了安全、稳定的运行环境。
|
||||
本部署方案采用Docker容器化部署,实现了前后端分离的架构,支持一键部署和自动化管理。通过宝塔面板的反向代理功能,实现了域名访问和SSL证书配置,为系统提供了安全、稳定的运行环境。
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
补充约定:
|
||||
|
||||
- `document_image`、`document_video` 只保存关联的 `attachments_id`,不直接存文件;当存在多个附件时,统一使用 `|` 分隔,例如:`ATT-001|ATT-002|ATT-003`。
|
||||
- `document_type` 使用多选字符串持久化,但格式特殊:`system_dict_id@dict_word_enum|system_dict_id@dict_word_enum`;前端显示时用枚举值描述,存库时保留该组合值。
|
||||
- `document_keywords`、`document_product_categories`、`document_application_scenarios`、`document_hotel_type` 统一使用竖线分隔字符串,例如:`分类A|分类B|分类C`。
|
||||
- `document_status` 仅允许 `有效`、`过期` 两种值,并由系统根据生效日期与到期日期自动计算;当两者都为空时默认 `有效`。
|
||||
- `document_owner` 的业务含义为“上传者openid”。
|
||||
- `attachments_link` 是 PocketBase `file` 字段,保存附件本体;访问链接由 PocketBase 根据记录和文件名生成。
|
||||
- 文档字段中,面向用户填写的字段里只有 `document_title`、`document_type` 设为必填,其余字段均允许为空。
|
||||
@@ -19,7 +21,7 @@
|
||||
| 字段名 | 类型 | 备注 |
|
||||
| :--- | :--- | :--- |
|
||||
| attachments_id | text | 附件业务 id,唯一标识符 |
|
||||
| attachments_link | file | 附件本体,单文件,不限制文件类型,单文件上限 100MB |
|
||||
| attachments_link | file | 附件本体,单文件,不限制文件类型,数据库字段上限已放宽到约 4GB |
|
||||
| attachments_filename | text | 原始文件名 |
|
||||
| attachments_filetype | text | 文件类型/MIME |
|
||||
| attachments_size | number | 附件大小 |
|
||||
@@ -46,7 +48,7 @@
|
||||
| document_id | text | 文档业务 id,唯一标识符 |
|
||||
| document_effect_date | date | 文档生效日期 |
|
||||
| document_expiry_date | date | 文档到期日期 |
|
||||
| document_type | text | 文档类型,必填 |
|
||||
| document_type | text | 文档类型,必填;多选时按 `system_dict_id@dict_word_enum|...` 保存 |
|
||||
| document_title | text | 文档标题,必填 |
|
||||
| document_subtitle | text | 文档副标题 |
|
||||
| document_summary | text | 文档摘要 |
|
||||
@@ -55,18 +57,18 @@
|
||||
| document_video | text | 关联多个 `attachments_id`,使用 `|` 分隔 |
|
||||
| document_owner | text | 上传者openid |
|
||||
| document_relation_model | text | 关联机型/模型标识 |
|
||||
| document_keywords | text | 关键词,竖线分隔 |
|
||||
| document_keywords | text | 关键词,多选后用 `|` 分隔保存 |
|
||||
| document_share_count | number | 分享次数 |
|
||||
| document_download_count | number | 下载次数 |
|
||||
| document_favorite_count | number | 收藏次数 |
|
||||
| document_status | text | 文档状态 |
|
||||
| document_status | text | 文档状态,仅允许 `有效` 或 `过期`,由系统依据生效日期和到期日期自动更新 |
|
||||
| document_embedding_status | text | 文档嵌入状态 |
|
||||
| document_embedding_error | text | 文档错误原因 |
|
||||
| document_embedding_lasttime | date | 最后更新日期 |
|
||||
| document_vector_version | text | 向量版本号或模型名称 |
|
||||
| document_product_categories | text | 适用产品类别,竖线分隔 |
|
||||
| document_application_scenarios | text | 适用场景,竖线分隔 |
|
||||
| document_hotel_type | text | 适用酒店类型,竖线分隔 |
|
||||
| document_product_categories | text | 产品关联文档,多选后从 `文档-产品关联文档` 字典保存为 `|` 分隔字符串 |
|
||||
| document_application_scenarios | text | 筛选依据,多选后从 `文档-筛选依据` 字典保存为 `|` 分隔字符串 |
|
||||
| document_hotel_type | text | 适用场景,多选后从 `文档-适用场景` 字典保存为 `|` 分隔字符串 |
|
||||
| document_remark | text | 备注 |
|
||||
|
||||
**索引规划:**
|
||||
|
||||
Reference in New Issue
Block a user