config = getConfig('.') DBPools(config.databases) dbname = get_module_dbname('cms') async with db.sqlorContext(dbname) as sor: data = {'id': params_kw.get('id', '')} if not data['id']: return {'widgettype': 'Message', 'options': {'text': '缺少ID', 'messagetype': 'error'}} for field in ['org_id', 'section_key', 'title', 'subtitle', 'section_type', 'content_type', 'sort_order', 'is_visible', 'display_config', 'style_config', 'static_content']: v = params_kw.get(field, None) if v is not None: data[field] = v await sor.U('cms_sections', data) return {'widgettype': 'Message', 'options': {'text': '更新成功', 'messagetype': 'success'}}