Merge branch 'main' of github.com:eolinker/eoapi

This commit is contained in:
夜鹰 2022-05-30 11:32:03 +08:00
commit 4bc79deb47
2 changed files with 7 additions and 1 deletions

View File

@ -5,7 +5,8 @@
</nz-radio-group>
<nz-divider nzType="vertical"></nz-divider>
<params-import *ngIf="['formData', 'json', 'xml'].includes(bodyType)" [baseData]="model" [contentType]="bodyType"
(baseDataChange)="handleParamsImport($event)" [rootType]="jsonRootType"></params-import>
(baseDataChange)="handleParamsImport($event)" (beforeHandleImport)="beforeHandleImport($event)"
[rootType]="jsonRootType"></params-import>
</div>
<div *ngIf="bodyType === 'json'">
<p class="fs12 c999 mb5">JSON 根类型:</p>

View File

@ -94,6 +94,11 @@ export class ApiTestBodyComponent implements OnInit, OnChanges, OnDestroy {
this.model = data;
this.modelChange.emit(data);
}
beforeHandleImport(result) {
this.jsonRootType = Array.isArray(result) ? 'array' : 'object';
}
rawDataChange() {
this.rawChange$.next(this.model);
}