fix: 修复 log 的 source 是 api object 时不自动加载的问题 (#9509)

This commit is contained in:
liaoxuezhi 2024-01-25 20:14:58 +08:00 committed by GitHub
parent 80610ec714
commit 7c79a84aa5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -161,11 +161,14 @@ export class Log extends React.Component<LogProps, LogState> {
);
}
if (this.props.source) {
const ret = resolveVariableAndFilter(
this.props.source,
this.props.data,
'| raw'
);
const ret =
typeof this.props.source === 'string'
? resolveVariableAndFilter(
this.props.source,
this.props.data,
'| raw'
)
: this.props.source;
if (ret && isEffectiveApi(ret)) {
this.loadLogs();
} else if (
@ -187,11 +190,10 @@ export class Log extends React.Component<LogProps, LogState> {
return;
}
const ret = resolveVariableAndFilter(
this.props.source,
this.props.data,
'| raw'
);
const ret =
typeof this.props.source === 'string'
? resolveVariableAndFilter(this.props.source, this.props.data, '| raw')
: this.props.source;
if (ret && isEffectiveApi(ret)) {
// todo 如果原来的请求还在,应该先取消