update 手动抛出的异常返回的code仍然为200

This commit is contained in:
2021-06-30 11:54:23 +08:00
parent 35cb452d09
commit 635dd52270
4 changed files with 63 additions and 27 deletions

View File

@@ -222,31 +222,33 @@ export default class QueryTable extends Component {
this.query = this.props.queryInitialValues
}
const res = await this.loadData(
{
pageIndex: this.pagination.current,
pageSize: this.pagination.pageSize,
...this.sorter,
},
cloneDeep(this.query)
)
if (res.rows || res.data || res.items) {
this.setState({
type: 'table',
dataSource: res.rows || res.data || res.items,
})
try {
const res = await this.loadData(
{
pageIndex: this.pagination.current,
pageSize: this.pagination.pageSize,
...this.sorter,
},
cloneDeep(this.query)
)
if (res.rows || res.data || res.items) {
this.setState({
type: 'table',
dataSource: res.rows || res.data || res.items,
})
this.pagination.total = res.totalCount
} else if (res) {
this.setState({
type: 'tree',
dataSource: clearChildren(res),
})
this.pagination.total = res.totalCount
} else if (res) {
this.setState({
type: 'tree',
dataSource: clearChildren(res),
})
this.pagination = false
this.pagination = false
}
} finally {
this.onLoaded()
}
this.onLoaded()
}
/**