fix(crud): get模板对confidential_fields脱敏——列表不再回显密文(防泄露+防编辑表单把掩码当值回写)

This commit is contained in:
yumoqing 2026-09-03 17:36:58 +08:00
parent 4667676b23
commit cdb5db57f3

View File

@ -203,7 +203,15 @@ debug(f'{sql=}')
db = DBPools()
dbname = get_module_dbname('{{modulename}}')
async with db.sqlorContext(dbname) as sor:
r = await sor.sqlPaging(sql, ns)
r = await sor.sqlPaging(sql, ns)
{% if confidential_fields %}
_conf_fields = {{json.dumps(confidential_fields)}}
if r and r.get('rows'):
for _row in r['rows']:
for _cf in _conf_fields:
if _row.get(_cf):
_row[_cf] = '******'
{% endif %}
return r
return {
"total":0,