yumoqing 7abdc336b7 fix(entcms): 重写所有数据库操作使用 async with context manager
_get_db() 返回的是 async context manager,不是 sor 对象。
所有函数都错误地直接调用 sor.R/C/U/D,导致 AttributeError。

修正为正确模式:
  db = DBPools()
  async with db.sqlorContext(DBNAME) as sor:
      await sor.R('table', ns)

影响函数:
- cms_content CRUD (4个)
- cms_categories CRUD (4个) + get_category_options
- cms_leads CRUD (4个) + submit_lead
- cms_sections CRUD (4个) + get_visible_sections
- cms_site_config CRUD (4个) + get_site_config
- get_published_content, get_latest_news, get_content_detail
- submit_content_for_approval
2026-06-03 17:24:55 +08:00
2026-06-03 15:48:54 +08:00
2026-06-03 16:34:00 +08:00
2026-06-03 16:34:00 +08:00
2026-06-03 16:34:00 +08:00
2026-06-03 16:34:00 +08:00

开元云科技 - 企业官网CMS系统

企业官网内容管理系统 + 钉钉审批流程基于Sage/bricks-framework开发。

模块

模块 说明
entcms 企业CMS - 新闻/案例/产品/Banner/线索管理
dingdingflow 钉钉审批流程 - 内容发布审批工作流

目录结构

cms/
├── conf/config.json          # 应用配置
├── wwwroot/                   # 前端静态文件(统一目录)
│   ├── index.ui, news.ui, ... # 企业官网页面
│   ├── api/*.dspy             # CMS后端API
│   └── dingdingflow/          # 钉钉审批模块前端
│       ├── index.ui, menu.ui
│       └── api/*.dspy
├── entcms/                    # 企业CMS Python模块
├── dingdingflow/              # 钉钉审批Python模块
├── bricks -> pkgs/bricks/dist # 前端框架(符号链接)
├── build.sh                   # 构建脚本
├── start.sh / stop.sh         # 启停脚本
├── init_superuser_permissions.py  # superuser权限初始化
├── init_any_permissions.py    # any权限初始化
└── scripts/init_superuser.py  # 超级用户账号初始化

快速开始

# 1. 构建并安装
cd ~/repos/cms && ./build.sh

# 2. 配置RBAC权限
cd ~/repos/sage
./py3/bin/python ~/repos/cms/entcms/scripts/load_path.py
./py3/bin/python ~/repos/cms/dingdingflow/scripts/load_path.py

# 3. 重启Sage
./stop.sh && ./start.sh

文档

环境变量 (dingdingflow)

DINGTALK_APP_KEY=xxx
DINGTALK_APP_SECRET=xxx
DINGTALK_AGENT_ID=xxx
Description
No description provided
Readme 245 KiB
Languages
Python 99.9%
Shell 0.1%