update 手动抛出的异常返回的code仍然为200
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user