34 lines
1.3 KiB
JavaScript
34 lines
1.3 KiB
JavaScript
import { BackendRuntimeContext as DependentBackendRuntimeContext } from './DependentContext';
|
|
import { unset } from 'oak-domain/lib/utils/lodash';
|
|
export class BackendRuntimeContext extends DependentBackendRuntimeContext {
|
|
async toString() {
|
|
const data = await this.getSerializedData();
|
|
return JSON.stringify(data);
|
|
}
|
|
async refineOpRecords() {
|
|
await super.refineOpRecords();
|
|
for (const opRecord of this.opRecords) {
|
|
if (opRecord.a === 's') {
|
|
const { d } = opRecord;
|
|
for (const entity in d) {
|
|
if (['application', 'system'].includes(entity)) {
|
|
// todo 删除掉config中的敏感返回信息
|
|
const rowDict = d[entity];
|
|
for (const id in rowDict) {
|
|
const { payConfig } = rowDict[id];
|
|
if (payConfig) {
|
|
payConfig.forEach((config) => {
|
|
unset(config, 'publicKeyFilePath');
|
|
unset(config, 'privateKeyFilePath');
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
;
|
|
export default BackendRuntimeContext;
|