fix: sandbox_run 审计 result 用 rc==0 判断(run 返回无 ok 键)

This commit is contained in:
ymq 2026-08-14 13:39:26 +08:00
parent e33bd24227
commit ece913f186

View File

@ -82,7 +82,7 @@ elif action == 'run':
r = await run_in_work_env(sor, account_name, user_id, _org, command, workdir, timeout, network)
await audit_log(sor, user_id, username, 'sandbox_run',
target=account_name, detail=str(command)[:500],
result='ok' if r.get('ok') else 'fail',
result='ok' if r.get('rc') == 0 else 'fail',
client_ip=client_ip)
return json.dumps({'ok': True, **r}, ensure_ascii=False)
except Exception as e: