fix: CMS completeness修复 — products.ui + 钉钉回调同步 + 文档路径
- P0: 新增 products.ui 产品架构页面 - P1: 实现钉钉审批回调→cms_content状态同步(approved→published, rejected→draft) - P2: 修复 docs/architecture.md 路径(/entcms/* → /*),补充cms_sections表 - P2: 重命名 init_superuser.py → init_superuser_permissions.py 避免与scripts/冲突 - build.sh 更新构建后步骤说明
This commit is contained in:
parent
a4a885f638
commit
f57bb0b0af
5
build.sh
5
build.sh
@ -191,7 +191,10 @@ echo " py3/bin/python entcms/scripts/load_path.py"
|
|||||||
echo " py3/bin/python dingdingflow/scripts/load_path.py"
|
echo " py3/bin/python dingdingflow/scripts/load_path.py"
|
||||||
echo " 4. 初始化超级用户:"
|
echo " 4. 初始化超级用户:"
|
||||||
echo " py3/bin/python scripts/init_superuser.py"
|
echo " py3/bin/python scripts/init_superuser.py"
|
||||||
echo " 5. 启动应用:"
|
echo " 5. 初始化权限:"
|
||||||
|
echo " py3/bin/python init_superuser_permissions.py"
|
||||||
|
echo " py3/bin/python init_any_permissions.py"
|
||||||
|
echo " 6. 启动应用:"
|
||||||
echo " ./start.sh"
|
echo " ./start.sh"
|
||||||
echo ""
|
echo ""
|
||||||
echo "访问地址: http://localhost:9090/"
|
echo "访问地址: http://localhost:9090/"
|
||||||
|
|||||||
@ -383,14 +383,18 @@ async def handle_dingtalk_callback(data):
|
|||||||
await update_dd_approval(update_data)
|
await update_dd_approval(update_data)
|
||||||
logger.info("Callback: approval %s updated to %s", record_id, new_status)
|
logger.info("Callback: approval %s updated to %s", record_id, new_status)
|
||||||
|
|
||||||
# TODO: Notify entcms module about status change
|
# Notify entcms module about status change
|
||||||
# This would trigger content status update in the CMS
|
|
||||||
biz_type = getattr(record, "biz_type", "")
|
biz_type = getattr(record, "biz_type", "")
|
||||||
biz_id = getattr(record, "biz_id", "")
|
biz_id = getattr(record, "biz_id", "")
|
||||||
logger.info(
|
if biz_type == "content_publish" and biz_id:
|
||||||
"Callback: should notify entcms: biz_type=%s, biz_id=%s, status=%s",
|
content_status = "published" if new_status == "approved" else "draft" if new_status == "rejected" else ""
|
||||||
biz_type, biz_id, new_status
|
if content_status:
|
||||||
)
|
content_update = {"id": biz_id, "status": content_status}
|
||||||
|
if content_status == "published":
|
||||||
|
content_update["published_at"] = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
||||||
|
async with db.sqlorContext(dbname) as sor:
|
||||||
|
await sor.U("cms_content", content_update)
|
||||||
|
logger.info("Callback: cms_content %s updated to %s", biz_id, content_status)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"success": True,
|
"success": True,
|
||||||
|
|||||||
@ -13,21 +13,24 @@
|
|||||||
|------|------|
|
|------|------|
|
||||||
| cms_content | 统一内容表(新闻/案例/产品/Banner),带发布审批状态流 |
|
| cms_content | 统一内容表(新闻/案例/产品/Banner),带发布审批状态流 |
|
||||||
| cms_categories | 内容分类(支持层级,按content_type分组) |
|
| cms_categories | 内容分类(支持层级,按content_type分组) |
|
||||||
|
| cms_sections | 栏目管理 |
|
||||||
| cms_leads | 商机线索(网站访客提交 + 未来AI抽取) |
|
| cms_leads | 商机线索(网站访客提交 + 未来AI抽取) |
|
||||||
| cms_site_config | 站点配置(Hero标语、页脚信息等KV配置) |
|
| cms_site_config | 站点配置(Hero标语、页脚信息等KV配置) |
|
||||||
|
|
||||||
**公开页面 (any权限)**:
|
**公开页面 (any权限)**:
|
||||||
- `/entcms/index.ui` - 官网首页(7个模块:导航/Hero/产品/案例/新闻/页脚/浮动入口)
|
- `/index.ui` - 官网首页(7个模块:导航/Hero/产品/案例/新闻/页脚/浮动入口)
|
||||||
- `/entcms/news.ui` - 新闻列表
|
- `/products.ui` - 产品架构列表
|
||||||
- `/entcms/news_detail.ui` - 新闻详情
|
- `/news.ui` - 新闻列表
|
||||||
- `/entcms/cases.ui` - 案例列表
|
- `/news_detail.ui` - 新闻详情
|
||||||
|
- `/cases.ui` - 案例列表
|
||||||
|
|
||||||
**管理页面 (logined权限)**:
|
**管理页面 (logined权限)**:
|
||||||
- `/entcms/admin.ui` - 管理后台仪表盘
|
- `/admin.ui` - 管理后台仪表盘
|
||||||
- `/entcms/cms_content_list` - 内容CRUD
|
- `/cms_content_list` - 内容CRUD
|
||||||
- `/entcms/cms_categories_list` - 分类CRUD
|
- `/cms_categories_list` - 分类CRUD
|
||||||
- `/entcms/cms_leads_list` - 线索CRUD
|
- `/cms_sections_list` - 栏目CRUD
|
||||||
- `/entcms/cms_site_config_list` - 配置CRUD
|
- `/cms_leads_list` - 线索CRUD
|
||||||
|
- `/cms_site_config_list` - 配置CRUD
|
||||||
|
|
||||||
**内容审批流程**:
|
**内容审批流程**:
|
||||||
编辑创建内容(草稿) → 提交审批(status=pending) → 钉钉审批 → 审批通过(status=approved) → 发布(status=published)
|
编辑创建内容(草稿) → 提交审批(status=pending) → 钉钉审批 → 审批通过(status=approved) → 发布(status=published)
|
||||||
|
|||||||
13
entcms/wwwroot/products.ui
Normal file
13
entcms/wwwroot/products.ui
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{% set products = get_published_content('product', 50) %}
|
||||||
|
{
|
||||||
|
"widgettype": "VBox",
|
||||||
|
"options": {"width": "100%", "css": "site-root"},
|
||||||
|
"subwidgets": [
|
||||||
|
{
|
||||||
|
"widgettype": "Html",
|
||||||
|
"options": {
|
||||||
|
"html": "<nav class=\"nav-bar\"><a class=\"nav-logo\" href=\"{{entire_url('index.ui')}}\">开元云科技<\/a><ul class=\"nav-links\"><li><a href=\"{{entire_url('index.ui')}}#products\">产品架构<\/a><\/li><li><a href=\"{{entire_url('index.ui')}}#cases\">成功案例<\/a><\/li><li><a href=\"{{entire_url('news.ui')}}\">企业动态<\/a><\/li><\/ul><\/nav><section class=\"section\" style=\"padding-top:100px\"><h2 class=\"section-title\">产品架构<\/h2><p class=\"section-desc\">AI基础设施全栈解决方案<\/p><div class=\"cases-grid\">{% for p in products %}<div class=\"case-card\"><div class=\"case-tag\">{{p.tags or '核心产品'}}<\/div><div class=\"case-title\">{{p.title}}<\/div><div class=\"case-desc\">{{p.summary_text}}<\/div><\/div>{% endfor %}<\/div><div class=\"cta-banner\" style=\"margin-top:40px\"><div class=\"cta-text\">需要定制化方案?<\/div><a class=\"btn-primary\" href=\"{{entire_url('index.ui')}}#contact\">联系解决方案团队 →<\/a><\/div><\/section><footer class=\"site-footer\"><p>© 2026 开元云科技 · 国家级高新技术企业 · 专精特新企业<\/p><\/footer>"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user