1. 角色体系(owner企业类型): - superuser: 超级用户(继承全部权限) - webmaster: 内容管理员(CRUD全部内容/分类/栏目/配置/线索) - reviewer: 内容审核(查看内容+审批状态更新) - supervisor: 主管(只读全部+线索管理+审批) - customer-support: 客服(线索查看和更新) - anonymous: 匿名用户(公开页面+提交线索) 2. 超级用户初始化脚本(scripts/init_superuser.py) - 默认: admin/admin123 - 自动创建用户+分配owner.superuser角色 3. cms_sections栏目管理表: - section_key: 栏目标识(hero/products/cases/news/cta/footer/float) - display_config: 展示配置JSON(布局/列数/悬停效果) - style_config: 样式配置JSON(颜色/渐变/边框) - static_content: 静态内容(Hero标语/产品卡片/CTA文案) - is_visible: 显示/隐藏控制 - sort_order: 栏目排序 4. cms_categories增加display_config字段(分类展示风格) 5. 初始化6个栏目数据(Hero/产品/案例/新闻/页脚/浮动入口) 6. 更新菜单和管理后台增加栏目管理入口
21 lines
628 B
Plaintext
21 lines
628 B
Plaintext
import json
|
|
from appPublic.uniqueID import getID
|
|
|
|
config = getConfig('.')
|
|
DBPools(config.databases)
|
|
dbname = get_module_dbname('entcms')
|
|
sor = DBPools().sqlorContext(dbname)
|
|
|
|
ns = {'is_visible': '1', 'sort': 'sort_order asc'}
|
|
rows = await sor.R('cms_sections', ns)
|
|
# Parse JSON fields
|
|
for r in rows:
|
|
for field in ['display_config', 'style_config', 'static_content']:
|
|
v = r.get(field, None)
|
|
if v and isinstance(v, str):
|
|
try:
|
|
r[field] = json.loads(v)
|
|
except:
|
|
pass
|
|
print(json.dumps({'status': 'ok', 'rows': rows, 'total': len(rows)}, ensure_ascii=False))
|