17 lines
471 B
Plaintext
17 lines
471 B
Plaintext
|
|
config = getConfig('.')
|
|
DBPools(config.databases)
|
|
dbname = get_module_dbname('cms')
|
|
async with db.sqlorContext(dbname) as sor:
|
|
|
|
_id = params_kw.get('id', '')
|
|
if not _id:
|
|
return {'status': 'error', 'message': '缺少ID'}
|
|
else:
|
|
ns = {'id': _id}
|
|
rows = await sor.R('cms_content', ns)
|
|
if rows:
|
|
return {'status': 'ok', 'data': rows[0]}
|
|
else:
|
|
return {'status': 'error', 'message': '内容不存在'}
|