fix(crud): get模板对confidential_fields脱敏——列表不再回显密文(防泄露+防编辑表单把掩码当值回写)
This commit is contained in:
parent
4667676b23
commit
cdb5db57f3
@ -203,7 +203,15 @@ debug(f'{sql=}')
|
|||||||
db = DBPools()
|
db = DBPools()
|
||||||
dbname = get_module_dbname('{{modulename}}')
|
dbname = get_module_dbname('{{modulename}}')
|
||||||
async with db.sqlorContext(dbname) as sor:
|
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 r
|
||||||
return {
|
return {
|
||||||
"total":0,
|
"total":0,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user